UKismetInputLibrary::Key_GetNavigationActionFromKey
#include "Kismet/KismetInputLibrary.h"
Access: public
Specifiers: staticBlueprintPure
Description
Returns the UI navigation action (Accept, Back, or Invalid) corresponding to the key in this key event, or Invalid if no mapping exists.
Caveats & Gotchas
- • Depends on the active Slate navigation config at the time the event fires, so the same physical key can map differently in different widgets or platforms.
- • Only usable from a widget's OnKeyDown/OnKeyUp override or similar UMG event, since it requires a live FKeyEvent, not a bare FKey.
Signature
static EUINavigationAction Key_GetNavigationActionFromKey(const FKeyEvent& InKeyEvent); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| InKeyEvent | const FKeyEvent& | The key event to map to a UI navigation action. | — |
Return Type
EUINavigationAction Example
Handle Accept in a UMG widget OnKeyDown C++
FReply UMyWidget::NativeOnKeyDown(const FGeometry& InGeometry, const FKeyEvent& InKeyEvent)
{
if (UKismetInputLibrary::Key_GetNavigationActionFromKey(InKeyEvent) == EUINavigationAction::Accept)
{
ConfirmSelection();
return FReply::Handled();
}
return FReply::Unhandled();
} See Also
Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?