lc-soft / LCUI

C library for building user interfaces
https://lcui-dev.github.io
MIT License
4.15k stars 357 forks source link

[linux] [x11] non-qwerty keyboard layouts broken #147

Closed coderobe closed 6 years ago

coderobe commented 6 years ago

The text inputs register the wrong chars with non-qwerty keyboard layouts. The STDOUT output prints the correct chars.

Reproduction Steps:

  1. Change keyboard layout to qwertz (de)
  2. Focus a text input
  3. Press the , key
  4. Hold left shift
  5. Press the same key again

The text input now shows ,< which is correct for qwerty, but wrong for qwertz (de) STDOUT logs this:

linux/linux_x11keyboard.c 103: OnKeyboardMessage(): keyname: comma
linux/linux_x11keyboard.c 105: OnKeyboardMessage(): keycode: 188, keyscancode: 59, keysym: 44
linux/linux_x11keyboard.c 112: OnKeyboardMessage(): char: ,
linux/linux_x11keyboard.c 103: OnKeyboardMessage(): keyname: comma
linux/linux_x11keyboard.c 105: OnKeyboardMessage(): keycode: 188, keyscancode: 59, keysym: 44
linux/linux_x11keyboard.c 112: OnKeyboardMessage(): char: ,
linux/linux_x11keyboard.c 103: OnKeyboardMessage(): keyname: Shift_L
linux/linux_x11keyboard.c 105: OnKeyboardMessage(): keycode: 16, keyscancode: 50, keysym: 65505
linux/linux_x11keyboard.c 103: OnKeyboardMessage(): keyname: comma
linux/linux_x11keyboard.c 105: OnKeyboardMessage(): keycode: 188, keyscancode: 59, keysym: 44
ime.c 232: LCUIIME_ToText(): hit shift, ch: ,
linux/linux_x11keyboard.c 112: OnKeyboardMessage(): char: ;
linux/linux_x11keyboard.c 103: OnKeyboardMessage(): keyname: comma
linux/linux_x11keyboard.c 105: OnKeyboardMessage(): keycode: 188, keyscancode: 59, keysym: 44
linux/linux_x11keyboard.c 112: OnKeyboardMessage(): char: ;
linux/linux_x11keyboard.c 103: OnKeyboardMessage(): keyname: Shift_L
linux/linux_x11keyboard.c 105: OnKeyboardMessage(): keycode: 16, keyscancode: 50, keysym: 65505

The OnKeyboardMessage(): char log corresponds to the text input ,;, which is the correct output for this keyboard layout. The text input still has the wrong characters.

LCUI version: current git master OS and version: Linux 4.15.6

coderobe commented 6 years ago

as far as i know, this is still unsolved and should not be closed because it's "stale"

lc-soft commented 6 years ago

Please try to use the branch fix_147_update_ime to test again.