How to hold a key

Asked by Adam Pospelovsky

Hi,
I just need to make Sikuli holding a CTRL key while running a function. How can I do that?
Something like a:
def myFunction ():
     hold(Key.CTRL) // still hold this until the for is finished
     for x in findAll("someimage.png"):
    click(x)

and then call a function like this:

myFunction();

Is that possible?

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
masuo
Solved:
Last query:
Last reply:
Revision history for this message
Best masuo (masuo-ohara) said :
#1
Revision history for this message
Adam Pospelovsky (adampos) said :
#2

Thanks masuo, that solved my question.