1
0
Fork 0

Added accept_event() calls for SceneTreeDock and BaseButton

This commit is contained in:
Eric M 2020-09-16 10:44:38 +10:00
parent 18023cc3ed
commit 9d7d20a978
2 changed files with 6 additions and 0 deletions

View File

@ -114,7 +114,12 @@ void SceneTreeDock::_unhandled_key_input(Ref<InputEvent> p_event) {
_tool_selected(TOOL_COPY_NODE_PATH); _tool_selected(TOOL_COPY_NODE_PATH);
} else if (ED_IS_SHORTCUT("scene_tree/delete", p_event)) { } else if (ED_IS_SHORTCUT("scene_tree/delete", p_event)) {
_tool_selected(TOOL_ERASE); _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) { void SceneTreeDock::instance(const String &p_file) {

View File

@ -327,6 +327,7 @@ Ref<Shortcut> BaseButton::get_shortcut() const {
void BaseButton::_unhandled_input(Ref<InputEvent> p_event) { 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)) { if (!is_disabled() && is_visible_in_tree() && !p_event->is_echo() && shortcut.is_valid() && shortcut->is_shortcut(p_event)) {
on_action_event(p_event); on_action_event(p_event);
accept_event();
} }
} }