Typing Text in Sikuli

Sikuli provides two functions for entering text into applications, type() and paste().

Typing on Special Keyboard Layouts

The function type() simulates keyboard typing just as a user types text in a application. However, type() doesn't work for different keyboard layouts other than QWERTY, such as DVORAK. We provide a workaround paste() since 0.9.7 (20100127). The function paste() transfers text through system's clipboard, which is fully independent of keyboard layouts. A sample usage that paste "network" into a search box is shown as follows.

paste( , "network")

Special Keys

If you would like to type special keys, such as ESC, F1, ENTER, BACKSPACE, etc, you may use the pre-defined constants in the Key class. For example, to type  http://sikuli.org and press Enter, you can write

type("http://sikuli.org" + Key.ENTER)

The special keys can be concatenated with '+', e.g. type(Key.ESC + "something" + Key.TAB + Key.DOWN + Key.ENTER). To learn the complete list of special keys, please see the Key class.

Attachments