diff options
author | Hilderin <81109165+Hilderin@users.noreply.github.com> | 2024-07-07 10:44:38 -0400 |
---|---|---|
committer | Hilderin <81109165+Hilderin@users.noreply.github.com> | 2024-07-07 15:53:48 -0400 |
commit | a7c4522c04e3e89ae821f19246c545f4d10b5f59 (patch) | |
tree | ee4502cbe43c4901fb14ba89581cb2a6b6dad9a6 | |
parent | f3af22b10b1e64146d48be7726f6395c9a4185e9 (diff) | |
download | redot-engine-a7c4522c04e3e89ae821f19246c545f4d10b5f59.tar.gz |
Fix custom shortcut Ctrl-Space in Script Editor add a space
-rw-r--r-- | editor/editor_node.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 632b36c705..e883c296ac 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -317,14 +317,10 @@ void EditorNode::shortcut_input(const Ref<InputEvent> &p_event) { Ref<InputEventKey> k = p_event; if ((k.is_valid() && k->is_pressed() && !k->is_echo()) || Object::cast_to<InputEventShortcut>(*p_event)) { - EditorPlugin *old_editor = editor_plugin_screen; - + bool is_handled = true; if (ED_IS_SHORTCUT("editor/filter_files", p_event)) { FileSystemDock::get_singleton()->focus_on_filter(); - get_tree()->get_root()->set_input_as_handled(); - } - - if (ED_IS_SHORTCUT("editor/editor_2d", p_event)) { + } else if (ED_IS_SHORTCUT("editor/editor_2d", p_event)) { editor_select(EDITOR_2D); } else if (ED_IS_SHORTCUT("editor/editor_3d", p_event)) { editor_select(EDITOR_3D); @@ -343,9 +339,10 @@ void EditorNode::shortcut_input(const Ref<InputEvent> &p_event) { } else if (ED_IS_SHORTCUT("editor/toggle_last_opened_bottom_panel", p_event)) { bottom_panel->toggle_last_opened_bottom_panel(); } else { + is_handled = false; } - if (old_editor != editor_plugin_screen) { + if (is_handled) { get_tree()->get_root()->set_input_as_handled(); } } |