UKismetInputLibrary::Key_GetNavigationDirectionFromKey
#include "Kismet/KismetInputLibrary.h"
Access: public
Specifiers: staticBlueprintPure
Description
Returns the directional UI navigation value (Up, Down, Left, Right, Next, Previous, or Invalid) corresponding to the key in this key event.
Caveats & Gotchas
- • Distinct from Key_GetNavigationActionFromKey — this reports directional movement (arrow-key style), while the other reports Accept/Back actions.
- • Result depends on the active Slate navigation config, so custom widgets that install their own config can remap which physical keys produce which direction.
Signature
static EUINavigation Key_GetNavigationDirectionFromKey(const FKeyEvent& InKeyEvent); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| InKeyEvent | const FKeyEvent& | The key event to map to a UI navigation direction. | — |
Return Type
EUINavigation Example
Move focus on directional key press C++
FReply UMyWidget::NativeOnKeyDown(const FGeometry& InGeometry, const FKeyEvent& InKeyEvent)
{
EUINavigation Direction = UKismetInputLibrary::Key_GetNavigationDirectionFromKey(InKeyEvent);
if (Direction != EUINavigation::Invalid)
{
NavigateFocus(Direction);
return FReply::Handled();
}
return FReply::Unhandled();
} See Also
Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?