summaryrefslogtreecommitdiffstats
path: root/core/input/input_event.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-03-03 11:02:53 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-03-03 11:02:53 +0100
commitd76c1c4f45106d4b2447e01d243cc3e0e65e5a7d (patch)
tree87993384e880eff316c0044eb90c4da1addfaba6 /core/input/input_event.cpp
parenteafc88c83527af39ab8aff55884d6348d1ca0f84 (diff)
parent52de40310a9d98496aa3de5aaf457a7e60959b77 (diff)
downloadredot-engine-d76c1c4f45106d4b2447e01d243cc3e0e65e5a7d.tar.gz
Merge pull request #73651 from hakro/editor-freelook-physical-shortcuts
Use physical shortcuts for freelook navigation in the editor
Diffstat (limited to 'core/input/input_event.cpp')
-rw-r--r--core/input/input_event.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/core/input/input_event.cpp b/core/input/input_event.cpp
index a6c1bb168c..9d5d84a508 100644
--- a/core/input/input_event.cpp
+++ b/core/input/input_event.cpp
@@ -474,10 +474,15 @@ String InputEventKey::to_string() {
return vformat("InputEventKey: keycode=%s, mods=%s, physical=%s, pressed=%s, echo=%s", kc, mods, physical, p, e);
}
-Ref<InputEventKey> InputEventKey::create_reference(Key p_keycode) {
+Ref<InputEventKey> InputEventKey::create_reference(Key p_keycode, bool p_physical) {
Ref<InputEventKey> ie;
ie.instantiate();
- ie->set_keycode(p_keycode & KeyModifierMask::CODE_MASK);
+ if (p_physical) {
+ ie->set_physical_keycode(p_keycode & KeyModifierMask::CODE_MASK);
+ } else {
+ ie->set_keycode(p_keycode & KeyModifierMask::CODE_MASK);
+ }
+
ie->set_unicode(char32_t(p_keycode & KeyModifierMask::CODE_MASK));
if ((p_keycode & KeyModifierMask::SHIFT) != Key::NONE) {