Using type() with Special Characters or non QWERTY US keyboards

Created by Tsung-Hsiang Chang on on 2010-01-28
Keywords:
type keyboard special-charactres
Last updated by:
RaiMan on on 2013-01-02

When using type() you might find, that it is not typed, what you expect.

The general reason for all oddities is the fact, that type() only works on QWERTY US keyboard layouts. With any other keyboard layout only keys that send the same key code as the QWERTY US keyboard, are typed correctly (most letters and numbers and some special characters).

Solutions:

--- use paste() instead if only text has to be typed. additionally \n for ENTER and \t for TAB should work. Since paste() uses the clipboard related shortcut ctrl-V/cmd-V, no function keys are supported. If you need this, use paste() to type the text and type() to operate functional keys (read http://sikuli.org/docx/keys.html#Key)

--- try to find out, which key on your keyboard has to be used, to make type() do what you want (e.g. on some keyboards a " produces an @)

--- this might help to find some workarounds
http://symbolcodes.tlt.psu.edu/accents/index.html