diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-06-27 20:14:59 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-06-27 20:14:59 -0300 |
commit | ba5bc57816999804e3c392e9d1f94b528baa8c18 (patch) | |
tree | a1ab244a844c14dae70c0e2c928f5ae3dff0f362 /tools | |
parent | 972c2ad09f6a89e45e61987c9aa89cc3716d2b2b (diff) |
Figured out a way to fix event propagation for shortcuts and some other cases so they properly stop shortcuts if a modal window is open, closes #4848
Diffstat (limited to 'tools')
-rw-r--r-- | tools/editor/editor_node.cpp | 4 | ||||
-rw-r--r-- | tools/editor/scene_tree_dock.cpp | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 991444966d..962993a5d0 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -168,6 +168,10 @@ void EditorNode::_update_title() { void EditorNode::_unhandled_input(const InputEvent& p_event) { + if (Node::get_viewport()->get_modal_stack_top()) + return; //ignore because of modal window + + if (p_event.type==InputEvent::KEY && p_event.key.pressed && !p_event.key.echo && !gui_base->get_viewport()->gui_has_modal_stack()) { diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp index 30ffdf6664..ab5c6e5044 100644 --- a/tools/editor/scene_tree_dock.cpp +++ b/tools/editor/scene_tree_dock.cpp @@ -39,16 +39,20 @@ #include "multi_node_edit.h" #include "tools/editor/plugins/animation_player_editor_plugin.h" #include "animation_editor.h" - +#include "scene/main/viewport.h" void SceneTreeDock::_unhandled_key_input(InputEvent p_event) { + if (get_viewport()->get_modal_stack_top()) + return; //ignore because of modal window + uint32_t sc = p_event.key.get_scancode_with_modifiers(); if (!p_event.key.pressed || p_event.key.echo) return; + if (ED_IS_SHORTCUT("scene_tree/add_child_node", p_event)) { _tool_selected(TOOL_NEW); } |