FReply SDetailsViewBase::OnFocusReceived(const FGeometry& MyGeometry, const FFocusEvent& InFocusEvent) { FReply Reply = FReply::Handled(); if (InFocusEvent.GetCause() != EFocusCause::Cleared) { Reply.SetUserFocus(SearchBox.ToSharedRef(), InFocusEvent.GetCause()); } return Reply; }
FReply SMultiBoxWidget::OnFocusReceived( const FGeometry& MyGeometry, const FFocusEvent& InFocusEvent ) { if (InFocusEvent.GetCause() == EFocusCause::Navigation) { // forward focus to children return FocusNextWidget( EUINavigation::Next ); } return FReply::Unhandled(); }
FReply FSceneViewport::OnFocusReceived(const FFocusEvent& InFocusEvent) { CurrentReplyState = FReply::Handled(); if (ViewportClient != nullptr) { FScopedConditionalWorldSwitcher WorldSwitcher(ViewportClient); ViewportClient->ReceivedFocus(this); if ((FApp::IsGame() && !GIsEditor) || bIsPlayInEditorViewport) { if (IsForegroundWindow()) { bool bIsCursorForcedVisible = false; if (ViewportClient->GetWorld() && ViewportClient->GetWorld()->GetFirstPlayerController()) { bIsCursorForcedVisible = ViewportClient->GetWorld()->GetFirstPlayerController()->GetMouseCursor() != EMouseCursor::None; } const bool bPlayInEditorCapture = !bIsPlayInEditorViewport || InFocusEvent.GetCause() != EFocusCause::SetDirectly || bPlayInEditorGetsMouseControl; // capturing the mouse interferes with slate UI (like the virtual joysticks) if (FPlatformProperties::SupportsWindowedMode() && bPlayInEditorCapture && !bIsCursorForcedVisible && !FSlateApplication::Get().IsFakingTouchEvents()) { // Only require the user to click in the window the first time - after that return focus to the game so long as it was the last focused widget. // Means that tabbing in/out will return the mouse control to where it was & the in-game console won't leave the mouse under editor control. bPlayInEditorGetsMouseControl = true; CurrentReplyState.UseHighPrecisionMouseMovement(ViewportWidget.Pin().ToSharedRef()); CurrentReplyState.LockMouseToWidget(ViewportWidget.Pin().ToSharedRef()); } } else { CurrentReplyState.ClearUserFocus(true); } } } return CurrentReplyState; }
FReply SPropertyEditorText::OnFocusReceived( const FGeometry& MyGeometry, const FFocusEvent& InFocusEvent ) { // Forward keyboard focus to our editable text widget return FReply::Handled().SetUserFocus(PrimaryWidget.ToSharedRef(), InFocusEvent.GetCause()); }
FReply SEditorViewport::OnFocusReceived( const FGeometry& MyGeometry, const FFocusEvent& InFocusEvent ) { // forward focus to the viewport return FReply::Handled().SetUserFocus(ViewportWidget.ToSharedRef(), InFocusEvent.GetCause()); }
FReply SAssetSearchBox::OnFocusReceived( const FGeometry& MyGeometry, const FFocusEvent& InFocusEvent ) { // Forward keyboard focus to our editable text widget return FReply::Handled().SetUserFocus(InputText.ToSharedRef(), InFocusEvent.GetCause()); }