How to use short cut keys like "alt+s" or "shift+k" or alt +a" etc in the scripts

Asked by AKR

Trying to use short cut keys, suppose to invoke a option "Paper Size" in GUI I have to use shortcut key "alt + z" to select that option. How can this helps to use short cut keys.
Thanks in advance

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

Use type(string, modifiers)

alt + z is:
type("a", KEY_ALT)

shift + alt + z:
type("a", KEY_SHIFT | KEY_ALT) # modifier keys combined by | (or)

You have to be sure, that your app has the focus to accept your typing (e.g. swichApp())

Class Key: look at: http://sikuli.org/documentation.shtml#doc/pythondoc-python.edu.mit.csail.uid.Sikuli.html

Can you help with this problem?

Provide an answer of your own, or ask AKR for more information if necessary.

To post a message you must log in.