Gtk2 - wrong key code for "X" key
Original Reporter info from Mantis: zoran
-
Reporter name: Zoran Vučenović
Original Reporter info from Mantis: zoran
- Reporter name: Zoran Vučenović
Description:
In my LCL application, I am checking state of keys on keyboard.
I noticed that:
Pressing "X" key does not generate code VK_X (which is 88, as declared in LCLType unit, and it is Ord('X') as it should be).
Instead, code 149 is generated.
In OnKeyDown and OnKeyUp event, when pressing X key, I get keycode 149, instead of 88 ($58).
The function LCLIntf.GetKeyState behaves the same.
That is, when X is pressed:
- GetKeyState(149) and $80 <> 0) returns True
- GetKeyState(VK_X) and $80 <> 0 returns False.
Worth mentioning is that, in OnKeyPress I correctly get character 'X' (which is Chr(88)).
Steps to reproduce:
I am attaching simple application.
Which key code do you get when pressing "X"?
Additional information:
My system: Mint 19.2 Xfce, Lazarus 2.0.4, gtk2, FPC 3.0.4.
Please test with other widgetsets too.
Mantis conversion info:
- Mantis ID: 36077
- Build: 61869
- Version: 2.0.5 (SVN)