← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #230209]: keyboard and mouse click

 

Question #230209 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/230209

    Status: Open => Answered

Roman Podolyan proposed the following answer:
As far as I see, the current support for hotkeys in Sikuli is _limited_ to the functional keys, list of which can be found in the Key class documentation (http://doc.sikuli.org/keys.html#Key) . So I didn't found a way to use 1 cay not on numpad, but there are a lot of other keys one can use. 
 
 
You may use snippet from 
http://doc.sikuli.org/globals.html#Env.addHotkey

I used it (somewhat modified), and it worked for me (with Windows 7 / 64
, Java 6)


Here is the modified  code I used: 
=======
def ClickSkype(event):
   click("1369216596695.png")

# When the user pressed Ctrl+F1, click a Skype icon, saved as image 1369216596695.png
Env.addHotkey(Key.F1, KeyModifier.CTRL, ClickSkype)

wait(20)

popup("Test passed")
======= 
As you may see, the code is pretty the same. 

If you want to get rid of the key modifiers, set the modifier parameter
to 0 (kudos to RaiMan -
https://answers.launchpad.net/sikuli/+question/215002). That worked for
me too.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.