summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editor/scene_tree_dock.cpp5
-rw-r--r--scene/gui/base_button.cpp1
2 files changed, 6 insertions, 0 deletions
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index ec225c3c38..83e16a2dd2 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -114,7 +114,12 @@ void SceneTreeDock::_unhandled_key_input(Ref<InputEvent> p_event) {
_tool_selected(TOOL_COPY_NODE_PATH);
} else if (ED_IS_SHORTCUT("scene_tree/delete", p_event)) {
_tool_selected(TOOL_ERASE);
+ } else {
+ return;
}
+
+ // Tool selection was successful, accept the event to stop propagation.
+ accept_event();
}
void SceneTreeDock::instance(const String &p_file) {
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp
index 1a19c75d27..84e9fc187c 100644
--- a/scene/gui/base_button.cpp
+++ b/scene/gui/base_button.cpp
@@ -327,6 +327,7 @@ Ref<Shortcut> BaseButton::get_shortcut() const {
void BaseButton::_unhandled_input(Ref<InputEvent> p_event) {
if (!is_disabled() && is_visible_in_tree() && !p_event->is_echo() && shortcut.is_valid() && shortcut->is_shortcut(p_event)) {
on_action_event(p_event);
+ accept_event();
}
}