← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #140392]: How to simulate key pressed from Java project?

 

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

RaiMan proposed the following answer:
Using type() is only documented on the Python level.

the principle usage in Java is (as you might already know) (if the
cursor is already positioned by a click() before at the input field):

Screen.type(null, "characters to be typed", KEY_MOD)

Where KEY_MOD is an integer representing a combination of ALT, SHIFT,
CTRL, WIN/CMD/META - if 0, no modifier keys.

Special keys have to be incorporated into the string using some unicode
constants.

The easiest way to get into type() on Java level is to look into the code of Region.java at:
http://bazaar.launchpad.net/%7Esikuli-driver/sikuli/sikuli-x/annotate/head%3A/sikuli-script/src/main/java/org/sikuli/script/Region.java

The unicode table can be found near the bottom.

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