summaryrefslogtreecommitdiff
path: root/editor/editor_settings.cpp
diff options
context:
space:
mode:
authorHakim <hakim.rouatbi@gmail.com>2023-04-07 17:44:36 +0200
committerYuri Sizov <yuris@humnom.net>2023-04-07 17:44:36 +0200
commitb17f0f593e136ca67e2de1e845d194069fa23318 (patch)
tree6b7a3b1677cae49e6b2c4409ae8f984e32f3205f /editor/editor_settings.cpp
parent4762303f182e65c5293db8d22a4ce88521eba445 (diff)
Use physical shortcuts for freelook navigation in the editor
(cherry picked from commit 52de40310a9d98496aa3de5aaf457a7e60959b77)
Diffstat (limited to 'editor/editor_settings.cpp')
-rw-r--r--editor/editor_settings.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index 037bfbfd99..25c84e7447 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -1468,7 +1468,7 @@ Ref<Shortcut> ED_GET_SHORTCUT(const String &p_path) {
return sc;
}
-void ED_SHORTCUT_OVERRIDE(const String &p_path, const String &p_feature, Key p_keycode) {
+void ED_SHORTCUT_OVERRIDE(const String &p_path, const String &p_feature, Key p_keycode, bool p_physical) {
ERR_FAIL_NULL_MSG(EditorSettings::get_singleton(), "EditorSettings not instantiated yet.");
Ref<Shortcut> sc = EditorSettings::get_singleton()->get_shortcut(p_path);
@@ -1477,10 +1477,10 @@ void ED_SHORTCUT_OVERRIDE(const String &p_path, const String &p_feature, Key p_k
PackedInt32Array arr;
arr.push_back((int32_t)p_keycode);
- ED_SHORTCUT_OVERRIDE_ARRAY(p_path, p_feature, arr);
+ ED_SHORTCUT_OVERRIDE_ARRAY(p_path, p_feature, arr, p_physical);
}
-void ED_SHORTCUT_OVERRIDE_ARRAY(const String &p_path, const String &p_feature, const PackedInt32Array &p_keycodes) {
+void ED_SHORTCUT_OVERRIDE_ARRAY(const String &p_path, const String &p_feature, const PackedInt32Array &p_keycodes, bool p_physical) {
ERR_FAIL_NULL_MSG(EditorSettings::get_singleton(), "EditorSettings not instantiated yet.");
Ref<Shortcut> sc = EditorSettings::get_singleton()->get_shortcut(p_path);
@@ -1505,7 +1505,7 @@ void ED_SHORTCUT_OVERRIDE_ARRAY(const String &p_path, const String &p_feature, c
Ref<InputEventKey> ie;
if (keycode != Key::NONE) {
- ie = InputEventKey::create_reference(keycode);
+ ie = InputEventKey::create_reference(keycode, p_physical);
events.push_back(ie);
}
}
@@ -1518,13 +1518,13 @@ void ED_SHORTCUT_OVERRIDE_ARRAY(const String &p_path, const String &p_feature, c
sc->set_meta("original", events.duplicate(true));
}
-Ref<Shortcut> ED_SHORTCUT(const String &p_path, const String &p_name, Key p_keycode) {
+Ref<Shortcut> ED_SHORTCUT(const String &p_path, const String &p_name, Key p_keycode, bool p_physical) {
PackedInt32Array arr;
arr.push_back((int32_t)p_keycode);
- return ED_SHORTCUT_ARRAY(p_path, p_name, arr);
+ return ED_SHORTCUT_ARRAY(p_path, p_name, arr, p_physical);
}
-Ref<Shortcut> ED_SHORTCUT_ARRAY(const String &p_path, const String &p_name, const PackedInt32Array &p_keycodes) {
+Ref<Shortcut> ED_SHORTCUT_ARRAY(const String &p_path, const String &p_name, const PackedInt32Array &p_keycodes, bool p_physical) {
Array events;
for (int i = 0; i < p_keycodes.size(); i++) {
@@ -1539,7 +1539,7 @@ Ref<Shortcut> ED_SHORTCUT_ARRAY(const String &p_path, const String &p_name, cons
Ref<InputEventKey> ie;
if (keycode != Key::NONE) {
- ie = InputEventKey::create_reference(keycode);
+ ie = InputEventKey::create_reference(keycode, p_physical);
events.push_back(ie);
}
}