Open nandoflorestan opened 3 years ago
It's not clear what you mean by "change the keyboard layout". Please provide an example.
Example:
If this is still not clear, please ask a more specific question.
Oh, I see what you mean. I thought you were referencing the layout of a widget.
I imagine this is either and SDL2 issue, where it doesn't process the keyboard layout change, or kivy is ignoring some keyboard event. You may want to look at the sdl loop and see if we're not handling an event and submit a PR to fix if you can.
I should clarify that I am incompetent in Cython, C++ and SDL2.
I did find this ticket in the SDL2 bug tracker. Apparently, Kivy needs to handle the SDL_KEYMAPCHANGED event, and as far as I can see, it does not.
Personally I do not know enough to submit a PR.
Using the demo app from the other issue I just tried this on Windows and could not replicate.
I started with qwerty and hit the s
key. Then with app open I changed layout to dvorak, hit the same key again and the output was different:
Window: keycode=115, scancode=22, modifiers=['numlock']
Keyboard: keycode=(115, 's'), text=s, modifiers=['numlock']
Window: keycode=111, scancode=22, modifiers=['numlock']
Keyboard: keycode=(111, 'o'), text=o, modifiers=['numlock']
Interesting.
I am on Manjaro Linux, which uses X11 (not Wayland).
https://github.com/libsdl-org/SDL/issues?q=keyboard+layout+change+X11
Sounds like our x11 implementation is missing handling of some events. Specifically here we need to handle these events, but we don't.
(On Linux) if I change the keyboard layout, the Kivy app doesn't realize it. But it should. Almost all (non-Kivy) apps respond to keyboard layout changes immediately.