How to do a multi-touch on iphone emulator using Sikuli

Asked by Libo Cao

Guys,

I am trying to implement a multi-touch functionality on iphone simulator.

To do that, I need the Alt key to be hold and then drag the mouse from one location to another.

The problem is that I cannot find anything that can do drag and drop with key holding functions, any tips?

Thanks
Libo

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Libo Cao
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Libo Cao (libocao) said :
#1

I got it, it can be done by doing

dragDrop(locationA, locationB, KEY_ALT)

Revision history for this message
Libo Cao (libocao) said :
#2

I can think of several ways of doing it that it SHOULD work, however I run into problem in command line mode

The above method only works inside IDE, but when I was running it in a python script by doing
from python.edu.mit.csail.uid.Sikuli import *

it gives me error that dragDrop only takes two parameters, instead of three

I included Sikuli 1.0 Lib folder that was extracted from the sikuli-script.jar file and set up the command line mode to run my testsuite.

It looks like ton's of command when running inside python script is different from IDE mode, it does not even recognize keyUp or keyDown method. Did I include the library wrong?

Revision history for this message
Libo Cao (libocao) said :
#3

This is resolved.

First of all, you need to make sure using sikuli 1.0 you need to do

from sikuli.Sikuli import *

in your python script, then you can use this method

dragDrop(locationA, locationB, KEY_ALT)

For more details please refer to this post
https://answers.launchpad.net/sikuli/+question/108878

If you want to run in command mode, or calling other python modules that needs to also import sikuli, you need to apply Chang's patch and have specific setup inside your directly.