Godot Engine – Multi-platform 2D and 3D game engine
Fix double inputs when shortcut propagation is enabled
Michael Alexsanderfe4d9c7a6610
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cppindex e1161ec0c64..bac67089ca4 100644--- a/scene/main/viewport.cpp+++ b/scene/main/viewport.cpp@@ -3618,7 +3618,8 @@ void Viewport::_push_shortcut_input_internal(const Ref<InputEvent> &p_event) {ERR_FAIL_COND(!is_inside_tree());get_tree()->_call_input_pause(shortcut_input_group, SceneTree::CALL_INPUT_TYPE_SHORTCUT_INPUT, p_event, this);- if (!propagate_shortcuts_to_parent || is_input_handled()) {+ // Only InputEventKey needs to be propagated, since it's a per-window event.+ if (!propagate_shortcuts_to_parent || Object::cast_to<InputEventKey>(*p_event) == nullptr || is_input_handled()) {return;}