balena-io-experimental / balena-wpe

Fullscreen WebKit browser with hardware accelerated CSS, WebGL, and HTML5 video for the RaspberryPi 3.
Apache License 2.0
379 stars 77 forks source link

Keyboard layout #12

Open Julio-Guerra opened 6 years ago

Julio-Guerra commented 6 years ago

Hi,

First of all, nice job for this project. I would like to know how can I change the keyboard layout to something else than US qwerty? I tried the loadkeys command and to set the LANG variable but nothing changed.

Thank you

floion commented 6 years ago

cc @curcuz ^

petrosagg commented 6 years ago

@Julio-Guerra this is a bit harder than it sounds because WPE is running without any window/display manager underneath it. The keyboard events are handled here https://github.com/resin-io/WPEBackend-rdk/blob/master/src/input/LinuxInput/KeyboardEventHandlerLinuxInput.cpp#L164 where key codes are mapped to unicode characters. I already had to patch this version to fix issue #5. I guess to have multiple languages you'd have to add multiple mapping in there and also add logic to handle switching layouts using some combination like Alt + Shift.