From 943eed575b68a91dd5d4ca7e69d357fb7a893cd4 Mon Sep 17 00:00:00 2001 From: Robert Yevdokimov <105675984+ryevdokimov@users.noreply.github.com> Date: Sun, 16 Mar 2025 08:01:39 +0400 Subject: [PATCH] Fix `GridMap` shortcuts being triggered during freelook (mouse captured) --- modules/gridmap/editor/grid_map_editor_plugin.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/gridmap/editor/grid_map_editor_plugin.cpp b/modules/gridmap/editor/grid_map_editor_plugin.cpp index f4157ca7657..f8ea9d3b6d0 100644 --- a/modules/gridmap/editor/grid_map_editor_plugin.cpp +++ b/modules/gridmap/editor/grid_map_editor_plugin.cpp @@ -674,7 +674,9 @@ void GridMapEditor::_show_viewports_transform_gizmo(bool p_value) { } EditorPlugin::AfterGUIInput GridMapEditor::forward_spatial_input_event(Camera3D *p_camera, const Ref &p_event) { - if (!node) { + // If the mouse is currently captured, we are most likely in freelook mode. + // In this case, disable shortcuts to avoid conflicts with freelook navigation. + if (!node || Input::get_singleton()->get_mouse_mode() == Input::MOUSE_MODE_CAPTURED) { return EditorPlugin::AFTER_GUI_INPUT_PASS; }