From 1af06d3d4608b17c74caed951cd9579ccbba229d Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Thu, 5 Apr 2018 20:59:35 +0300 Subject: 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). --- core/os/input_event.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'core/os/input_event.h') 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 &p_event, bool *p_pressed, float *p_strength, float p_deadzone) const; virtual bool shortcut_match(const Ref &p_event) const; -- cgit v1.2.3