FSlateApplicationBase::SetKeyboardFocus

Sets keyboard focus to the specified widget. The widget must be allowed to receive keyboard focus.

Choose your operating system:

Windows

macOS

Linux

Override Hierarchy

FSlateApplicationBase::SetKeyboardFocus()

FSlateApplication::SetKeyboardFocus()

References

Module

SlateCore

Header

/Engine/Source/Runtime/SlateCore/Public/Application/SlateApplicationBase.h

Include

#include "Application/SlateApplicationBase.h"

Syntax

bool SetKeyboardFocus
(
    const FWidgetPath & InFocusPath,
    const EFocusCause InCause
)

Remarks

Sets keyboard focus to the specified widget. The widget must be allowed to receive keyboard focus.

Returns

true if the widget is now focused, false otherwise.

Parameters

Parameter

Description

InWidget

WidgetPath to the Widget to being focused

InCause

The reason that keyboard focus is changing