Tkinter defines keyboard layout

Is there a way to detect the current keyboard layout in Tkinter?

It is necessary to properly handle keyboard accelerators for languages ​​such as Russian, French, Greek (see my other question ).

0


source to share


1 answer


No, there is no such feature in Tkinter.

Why not just ask the app to ask the user where each special key is located when you first launch the app? Apple does this with OSX - it asked me to press a key pair the first time I downloaded a fresh install.



You can put focus on a widget and bind to <Any-KeyPress>

, and from that grab enough information to bind to whatever key is pressed.

0


source







All Articles