1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Linux/BSD: Modify only keypad keys

The `keycode` field of `InputEventKey` is supposed to be "unshifted";
That is, what the key would output if no modifier keys were pressed.
This should match what's written on the key label, but `Key` enumerates
also all keypad keys, which require a modifier. We thus require some
extra checks for them.

Note that this can still allow "stuck keys", but that's an even deeper
problem.
This commit is contained in:
Riteo
2025-01-29 20:24:46 +01:00
parent a013481b09
commit 140a63be25
6 changed files with 96 additions and 11 deletions

View File

@@ -56,6 +56,7 @@ class KeyMappingXKB {
public:
static void initialize();
static bool is_sym_numpad(xkb_keysym_t p_keysym);
static Key get_keycode(xkb_keysym_t p_keysym);
static xkb_keycode_t get_xkb_keycode(Key p_keycode);
static Key get_scancode(unsigned int p_code);