summaryrefslogtreecommitdiff
path: root/core/input/input_event.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/input/input_event.h')
-rw-r--r--core/input/input_event.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/core/input/input_event.h b/core/input/input_event.h
index 98d204fe13..57b6091123 100644
--- a/core/input/input_event.h
+++ b/core/input/input_event.h
@@ -34,6 +34,7 @@
#include "core/input/input_enums.h"
#include "core/io/resource.h"
#include "core/math/transform_2d.h"
+#include "core/os/keyboard.h"
#include "core/string/ustring.h"
#include "core/typedefs.h"
@@ -163,8 +164,8 @@ class InputEventKey : public InputEventWithModifiers {
bool pressed = false; /// otherwise release
- uint32_t keycode = 0; ///< check keyboard.h , KeyCode enum, without modifier masks
- uint32_t physical_keycode = 0;
+ Key keycode = KEY_NONE; // Key enum, without modifier masks.
+ Key physical_keycode = KEY_NONE;
uint32_t unicode = 0; ///unicode
bool echo = false; /// true if this is an echo key
@@ -176,11 +177,11 @@ public:
void set_pressed(bool p_pressed);
virtual bool is_pressed() const override;
- void set_keycode(uint32_t p_keycode);
- uint32_t get_keycode() const;
+ void set_keycode(Key p_keycode);
+ Key get_keycode() const;
- void set_physical_keycode(uint32_t p_keycode);
- uint32_t get_physical_keycode() const;
+ void set_physical_keycode(Key p_keycode);
+ Key get_physical_keycode() const;
void set_unicode(uint32_t p_unicode);
uint32_t get_unicode() const;
@@ -199,7 +200,7 @@ public:
virtual String as_text() const override;
virtual String to_string() override;
- static Ref<InputEventKey> create_reference(uint32_t p_keycode_with_modifier_masks);
+ static Ref<InputEventKey> create_reference(Key p_keycode_with_modifier_masks);
InputEventKey() {}
};