diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-03-01 23:00:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-01 23:00:42 +0100 |
commit | e2b66cacf78ae39b94df748e9740b98a1f011e77 (patch) | |
tree | 56d468d762c43879c20b342702e8fc999221e6c6 /core/os/input_event.h | |
parent | 55396d6e06f8e4e355e9ab0595bdb7f27c1c36dd (diff) | |
parent | 1af06d3d4608b17c74caed951cd9579ccbba229d (diff) |
Merge pull request #18020 from bruvzg/input_fix_non_latin_and_add_hw_scancodes
Fix non-latin layout scancodes on Linux, adds access to physical scancodes.
Diffstat (limited to 'core/os/input_event.h')
-rw-r--r-- | core/os/input_event.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/core/os/input_event.h b/core/os/input_event.h index c6b04bcfa5..c105fcd1c1 100644 --- a/core/os/input_event.h +++ b/core/os/input_event.h @@ -256,7 +256,8 @@ class InputEventKey : public InputEventWithModifiers { bool pressed; /// otherwise release - uint32_t scancode; ///< check keyboard.h , KeyCode enum, without modifier masks + uint32_t keycode; ///< check keyboard.h , KeyCode enum, without modifier masks + uint32_t physical_keycode; uint32_t unicode; ///unicode bool echo; /// true if this is an echo key @@ -268,8 +269,11 @@ public: void set_pressed(bool p_pressed); virtual bool is_pressed() const; - void set_scancode(uint32_t p_scancode); - uint32_t get_scancode() const; + void set_keycode(uint32_t p_keycode); + uint32_t get_keycode() const; + + void set_physical_keycode(uint32_t p_keycode); + uint32_t get_physical_keycode() const; void set_unicode(uint32_t p_unicode); uint32_t get_unicode() const; @@ -277,7 +281,8 @@ public: void set_echo(bool p_enable); virtual bool is_echo() const; - uint32_t get_scancode_with_modifiers() const; + uint32_t get_keycode_with_modifiers() const; + uint32_t get_physical_keycode_with_modifiers() const; virtual bool action_match(const Ref<InputEvent> &p_event, bool *p_pressed, float *p_strength, float p_deadzone) const; virtual bool shortcut_match(const Ref<InputEvent> &p_event) const; |