Changing language using sikuli

Asked by Oleg

I want to switch the language using sikuli.
That is, press the combination ALT + SHIFT.
This code didn't work
    keyDown(Key.ALT + Key.SHIFT)
    keyUp(Key.ALT + Key.SHIFT)

Im using linux, Debian, sikuli-ide-lux-2.0.5.jar

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

Try
    keyDown(Key.ALT)
    keyDown(Key.SHIFT)
    keyUp(Key.SHIFT)
    keyUp(Key.ALT)

Revision history for this message
Oleg (iizedii) said :
#2

Manfred Hampl (m-hampl), I already tried it, it doesn't work either ;(

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

Then I am sorry and cannot help. You may have to wait for RaiMan to answer.

Why do you want to change the language settings at all?
The operation of SIkuli's functions like paste("text") is independent of the language settings.

Revision history for this message
Oleg (iizedii) said :
#4

Manfred Hampl (m-hampl), I want to enter Cyrillic characters. When i use paste("Берёзовая роща") - this is entered "Берёзовая роща".
However at the beginning of the code there is a line # -*- coding: utf-8 -*-, this encoding must supports Cyrillic characters.

The same situation when I use # -*- coding: koi8-r -*-

Revision history for this message
Oleg (iizedii) said :
#5

I found a solution: paste(u"Берёзовая роща") - it works.
But I still don't understand why I can't click Alt+Shift

I changed the language switch in the system to Ctrl+Shift, and code
keyDown(Key.CTRL + Key.SHIFT)
keyUp(Key.CTRL + Key.SHIFT)
works.

Alt+Shift - it doesn't work in a similar way

Can you help with this problem?

Provide an answer of your own, or ask Oleg for more information if necessary.

To post a message you must log in.