kohi
kohi copied to clipboard
Linux Platform keyboard input fixes
Per a comment on YT from April E, can eliminate the need to globally turn off key repeats by doing the following:
- Solve the key repeating problem without needing to change it globally on the server by using the xkb extension to set the XCB_XKB_PER_CLIENT_FLAG_DETECTABLE_AUTO_REPEAT flag on.
Also from April E:
"I found the reason for the & ~0x80 being done on X11 events. Every event has an 8bit code. And the most significant bit in the code is set if the event was generated from a SendEvent request (like from a window manager vs the X server itself.) & ~0x80 = 0111 1111 so by anding it to the event you are clearing that top bit ensuring that you will always match your event code regardless of the event's origin. Arguably just anding by 0x7F would be better. Anyway...that's the reason behind it. So in your cases where you check for the pressed state you should do the same. You also want to free the replies you get when retrieving the WM_PROTOCOLS & WM_DELETE_WINDOW atoms."
Finally, add a static lookup table of key codes->keys and eliminate switch in translate function.