Cannot type slash character. This slash: "/"
This bug report was converted into a question: question #101902: Cannot type slash character. This slash: "/" --- workaround: alt + numpad.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SikuliX |
Invalid
|
Undecided
|
Unassigned |
Bug Description
When I issue the command on the line 3 of my script:
type("/")
The Sikuli IDE does not send the slash character ("/") and throw the following error:
[sikuli] [Error] source lineNo: 3
[sikuli] [Error] Traceback (innermost last):
File "C:\DOCUME~
File "C:\Arquivos de programas\
at sun.awt.
at java.awt.
at edu.mit.
at edu.mit.
at edu.mit.
at edu.mit.
at edu.mit.
at sun.reflect.
at sun.reflect.
at sun.reflect.
at java.lang.
java.lang.
Thanks for the attention and congratulation for this very useful tools :)
This is not really a bug, since per definition the type() internally uses the american keyboard layout.
On my german Mac keyboard e.g. type("/") produces a - (hyphen). this is the corresponding key on the US keyboard.
You have 2 options:
1. use paste() instead of type() if the target of your typing is some kind of input field. it uses internally the clipboard and in this cases always produces the correct result. You can intermix paste() (typing text) and type() (pressing special keys).
2. find out, what would be produced with an US layout, if you press the key, that produces / with your actual layout. use this instead. (e.g. in my german example type("&") actually produces "/" or type("7", KEY_SHIFT)).