diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2018-04-05 20:59:35 +0300 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2020-02-25 12:30:33 +0200 |
commit | 1af06d3d4608b17c74caed951cd9579ccbba229d (patch) | |
tree | a0d57c6cd3c00614a5a30290085e91a6097e78b6 /core/os/input_event.h | |
parent | 376a8255a9b65b016fcd81634bfd54fb7fa029df (diff) | |
download | redot-engine-1af06d3d4608b17c74caed951cd9579ccbba229d.tar.gz |
Rename `scancode` to `keycode`.
Add `physical_keycode` (keyboard layout independent keycodes) to InputEventKey and InputMap.
Fix non-latin keyboard layout keycodes on Linux/X11 (fallback to physical keycodes).
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; |