-
-
Notifications
You must be signed in to change notification settings - Fork 65
Description
As of the latest commit (09d94dc), a key press event contains the following information about what key is being pressed:
value: A representation of the physical button pressed;sym: The textual representation of the single pressed key, if it's printable.
On X11, which is what I tested, for keys that do not represent a printable character, such as Esc, the sym field will always contain 0. Therefore, the only way for an application to check for such a key is via its value (value == RGFW_escape). That, however, ignores the user's keyboard layout, which could have the physical key mapped to something else.
I, for instance, have Caps Lock and Esc swapped, so my physical Esc key performs the usual function of a Caps Lock, while the physical Caps Lock key is typically handled as an Esc by most applications (with the exception of games). Each key still produces it's original KeyCode, but XKB returns the correct (swapped) KeySym for each one.
One solution to this would be to expose the "KeySym" (what the key represents in a given layout in a given context) alongside the "KeyCode" (what physical key it is) for each key press, independently of the text it may represent.
I will add that I did all my tests on version 1.7.0, so sorry if something is outdated.