get current keyboard Layout

Asked by Sergey Taranenko on 2020-02-19

tell me how to know the current keyboard layout?
I found the getCurrentLayout() procedure in API/src/main/java/org/sikuli/script/support/KeyboardLayout.java but it is private.
what am i doing wrong ?

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
Sergey Taranenko
Solved:
2020-03-11
Last query:
2020-03-11
Last reply:
2020-02-19
RaiMan (raimund-hocke) said : #1

not intended for public use.

Sergey Taranenko (setar007) said : #2

Well, what other methods are there to solve the problem?

Manfred Hampl (m-hampl) said : #3

What is "the problem" that needs to be solved?

How would you know about the keyboard layout without sikuli?

Sergey Taranenko (setar007) said : #4

this work for me:

from java.awt.im import InputContext
def getKeyboardLang():
    return InputContext.getInstance().getLocale().toString()

print getKeyboardLang()