diff options
author | Hakim <hakim.rouatbi@gmail.com> | 2023-04-07 17:44:36 +0200 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-04-07 17:44:36 +0200 |
commit | b17f0f593e136ca67e2de1e845d194069fa23318 (patch) | |
tree | 6b7a3b1677cae49e6b2c4409ae8f984e32f3205f /editor/plugins | |
parent | 4762303f182e65c5293db8d22a4ce88521eba445 (diff) |
Use physical shortcuts for freelook navigation in the editor
(cherry picked from commit 52de40310a9d98496aa3de5aaf457a7e60959b77)
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/node_3d_editor_plugin.cpp | 16 | ||||
-rw-r--r-- | editor/plugins/node_3d_editor_plugin.h | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 7c5b8600d4..cdd61d7067 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -4872,8 +4872,8 @@ void Node3DEditorViewport::finish_transform() { } // Register a shortcut and also add it as an input action with the same events. -void Node3DEditorViewport::register_shortcut_action(const String &p_path, const String &p_name, Key p_keycode) { - Ref<Shortcut> sc = ED_SHORTCUT(p_path, p_name, p_keycode); +void Node3DEditorViewport::register_shortcut_action(const String &p_path, const String &p_name, Key p_keycode, bool p_physical) { + Ref<Shortcut> sc = ED_SHORTCUT(p_path, p_name, p_keycode, p_physical); shortcut_changed_callback(sc, p_path); // Connect to the change event on the shortcut so the input binding can be updated. sc->connect("changed", callable_mp(this, &Node3DEditorViewport::shortcut_changed_callback).bind(sc, p_path)); @@ -5054,12 +5054,12 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p view_menu->get_popup()->set_item_tooltip(shadeless_idx, unsupported_tooltip); } - register_shortcut_action("spatial_editor/freelook_left", TTR("Freelook Left"), Key::A); - register_shortcut_action("spatial_editor/freelook_right", TTR("Freelook Right"), Key::D); - register_shortcut_action("spatial_editor/freelook_forward", TTR("Freelook Forward"), Key::W); - register_shortcut_action("spatial_editor/freelook_backwards", TTR("Freelook Backwards"), Key::S); - register_shortcut_action("spatial_editor/freelook_up", TTR("Freelook Up"), Key::E); - register_shortcut_action("spatial_editor/freelook_down", TTR("Freelook Down"), Key::Q); + register_shortcut_action("spatial_editor/freelook_left", TTR("Freelook Left"), Key::A, true); + register_shortcut_action("spatial_editor/freelook_right", TTR("Freelook Right"), Key::D, true); + register_shortcut_action("spatial_editor/freelook_forward", TTR("Freelook Forward"), Key::W, true); + register_shortcut_action("spatial_editor/freelook_backwards", TTR("Freelook Backwards"), Key::S, true); + register_shortcut_action("spatial_editor/freelook_up", TTR("Freelook Up"), Key::E, true); + register_shortcut_action("spatial_editor/freelook_down", TTR("Freelook Down"), Key::Q, true); register_shortcut_action("spatial_editor/freelook_speed_modifier", TTR("Freelook Speed Modifier"), Key::SHIFT); register_shortcut_action("spatial_editor/freelook_slow_modifier", TTR("Freelook Slow Modifier"), Key::ALT); diff --git a/editor/plugins/node_3d_editor_plugin.h b/editor/plugins/node_3d_editor_plugin.h index e5267e5fad..c4193f0420 100644 --- a/editor/plugins/node_3d_editor_plugin.h +++ b/editor/plugins/node_3d_editor_plugin.h @@ -441,7 +441,7 @@ private: void update_transform(Point2 p_mousepos, bool p_shift); void finish_transform(); - void register_shortcut_action(const String &p_path, const String &p_name, Key p_keycode); + void register_shortcut_action(const String &p_path, const String &p_name, Key p_keycode, bool p_physical = false); void shortcut_changed_callback(const Ref<Shortcut> p_shortcut, const String &p_shortcut_path); protected: |