Explorar o código

Fixed freelook conflict with text inputs

Marc Gilleron %!s(int64=8) %!d(string=hai) anos
pai
achega
0fd66a4f8f
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      editor/plugins/spatial_editor_plugin.cpp

+ 5 - 0
editor/plugins/spatial_editor_plugin.cpp

@@ -775,6 +775,11 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
 				}
 
 				freelook_active = b->is_pressed();
+				if (freelook_active && !surface->has_focus()) {
+					// Focus usually doesn't trigger on right-click, but in case of freelook it should,
+					// otherwise using keyboard navigation would misbehave
+					surface->grab_focus();
+				}
 
 			} break;
 			case BUTTON_MIDDLE: {