From 3463855c8a5e94fa02f5bb408262c69919e46739 Mon Sep 17 00:00:00 2001 From: kobewi Date: Mon, 27 Oct 2025 12:45:46 +0100 Subject: [PATCH] Allow echo events for some Scene dock shortcuts --- editor/docks/scene_tree_dock.cpp | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/editor/docks/scene_tree_dock.cpp b/editor/docks/scene_tree_dock.cpp index 1d1f1d5ce6..bc100982ff 100644 --- a/editor/docks/scene_tree_dock.cpp +++ b/editor/docks/scene_tree_dock.cpp @@ -179,7 +179,24 @@ void SceneTreeDock::shortcut_input(const Ref &p_event) { return; } - if (!p_event->is_pressed() || p_event->is_echo()) { + if (!p_event->is_pressed()) { + return; + } + + // These shortcuts allow echo events for continuous execution. + if (ED_IS_SHORTCUT("scene_tree/duplicate", p_event)) { + _tool_selected(TOOL_DUPLICATE); + } else if (ED_IS_SHORTCUT("scene_tree/move_up", p_event)) { + _tool_selected(TOOL_MOVE_UP); + } else if (ED_IS_SHORTCUT("scene_tree/move_down", p_event)) { + _tool_selected(TOOL_MOVE_DOWN); + } else if (ED_IS_SHORTCUT("scene_tree/paste_node", p_event)) { + _tool_selected(TOOL_PASTE); + } else if (ED_IS_SHORTCUT("scene_tree/paste_node_as_sibling", p_event)) { + _tool_selected(TOOL_PASTE_AS_SIBLING); + } + + if (p_event->is_echo()) { return; } @@ -205,24 +222,14 @@ void SceneTreeDock::shortcut_input(const Ref &p_event) { _tool_selected(TOOL_CUT); } else if (ED_IS_SHORTCUT("scene_tree/copy_node", p_event)) { _tool_selected(TOOL_COPY); - } else if (ED_IS_SHORTCUT("scene_tree/paste_node", p_event)) { - _tool_selected(TOOL_PASTE); - } else if (ED_IS_SHORTCUT("scene_tree/paste_node_as_sibling", p_event)) { - _tool_selected(TOOL_PASTE_AS_SIBLING); } else if (ED_IS_SHORTCUT("scene_tree/paste_node_as_replacement", p_event)) { _tool_selected(TOOL_PASTE_AS_REPLACEMENT); } else if (ED_IS_SHORTCUT("scene_tree/change_node_type", p_event)) { _tool_selected(TOOL_CHANGE_TYPE); - } else if (ED_IS_SHORTCUT("scene_tree/duplicate", p_event)) { - _tool_selected(TOOL_DUPLICATE); } else if (ED_IS_SHORTCUT("scene_tree/attach_script", p_event)) { _tool_selected(TOOL_ATTACH_SCRIPT); } else if (ED_IS_SHORTCUT("scene_tree/detach_script", p_event)) { _tool_selected(TOOL_DETACH_SCRIPT); - } else if (ED_IS_SHORTCUT("scene_tree/move_up", p_event)) { - _tool_selected(TOOL_MOVE_UP); - } else if (ED_IS_SHORTCUT("scene_tree/move_down", p_event)) { - _tool_selected(TOOL_MOVE_DOWN); } else if (ED_IS_SHORTCUT("scene_tree/reparent", p_event)) { _tool_selected(TOOL_REPARENT); } else if (ED_IS_SHORTCUT("scene_tree/reparent_to_new_node", p_event)) {