type('`') odd behaviour

Asked by Alex Lunyov on 2017-11-11

Hi,

here is some addition to "type invalid key code" questions collection on Launchpad. May be a bug.

So, when I just started IDE and executed simple code:

     type('`') # there is one key to type, backquote (backtick), that belongs to American QWERTY layout

I got such an error:

*********************************************
[log] TYPE "`"
[error] script [ Безымянный ] stopped with error in line 1
[error] java.lang.IllegalArgumentException ( java.lang.IllegalArgumentException: Invalid key code )
*********************************************

Next, I corrected the command:

     type(u'`')

and got no errors:

*********************************************
[log] TYPE "`"
*********************************************

And at last, I deleted unicode prefix and there were no errors again.

Can't understand.

I use latest 1.1.2 nightly version of SikuliX.

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
Alex Lunyov
Solved:
2017-11-11
Last query:
2017-11-11
Last reply:
Alex Lunyov (lunyov-av) said : #1

OK, I've just resolved the problem. Nothing strange, in fact I use two layouts and while I run script in English layout the keystroke is correct. Otherwise it is invalid. So, I have to check the correct layout before I run the script.