소스 검색

Merge pull request #9281 from Zylann/fix_freelook_keyboard

Fixed freelook conflict with text inputs
Rémi Verschelde 8 년 전
부모
커밋
68891baa1b
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  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: {