Not supported character in keyDown()

Asked by Mychajlo Chodorev

I'm writing a script to automatize saving of the web page. So I try to send Ctrl+s with keyDown(). It seemed to work but now I'm getting an error:

> [error] java.lang.IllegalArgumentException ( java.lang.IllegalArgumentException: Key: Not supported character: s )
> [error] --- Traceback --- error source first
> line: module ( function ) statement
> 17: main ( <module> ) keyDown(Key.CTRL + "s")
> [error] --- Traceback --- end --------------

I tried to run it both in IDE and command line with same result.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

Please try with
type("s", Key.CTRL)

Revision history for this message
Mychajlo Chodorev (ralfeus) said :
#2

Same error was for type('s', Key.CTRL). But after several restarts the problem has gone. Weird...

Revision history for this message
Best RaiMan (raimund-hocke) said :
#3

I have another case, where the same error was shown for a type with Key.Win.

Do you have a non-US keyboard layout?

If yes, put as second or higher entry in the layout list EN (English US) (... but do not select it ;-)

Revision history for this message
Mychajlo Chodorev (ralfeus) said :
#4

Indeed I had active non-latin keyboard layout. When latin but non-English layout is active everything is ok. So only non-latin one causes problem.
Thank you

Revision history for this message
Mychajlo Chodorev (ralfeus) said :
#5

Thanks RaiMan, that solved my question.