Navigation
API > API/Developer > API/Developer/SlateReflector
HOW TO DEBUG NAVIGATION EVENTS Test the static result via FSlateNavigationEventSimulator. If the simulation doesn't work, your widget is probably not be configured properly. If the simulation does work, use the "WidgetReflector events log" or the "Console Slate Debugger" to get information on the navigation event while playing. A - If you do not find the event, check it has been consumed by the viewport or by a widget with OnKeyDown. B - If you find the event, note if the Reply and Consumed widget are different. i- If they are different, then use the "WidgetReflector routing" tool to understand why another widget has consumed the routing. For example, the widget can be disabled or it may have a custom OnNavigation event. ii- If they are not different, then the GameViewportClient or the application may have consumed the event. You may also check if you received the focus event with the "WidgetReflector events log" or with the "Console Slate Debugger". Simulate navigation attempt and collect the result for later display. Some elements may steel the navigation attempt dynamically and can be evaluated until evaluated in game. A list of elements that can still the navigation attempt and modify the result.
The viewport may consume the Navigation.
A widget may override the OnNavigation function and return a different result dynamically.
A widget can change its "enabled" and "supports keyboard focus" flags dynamically during gameplay.
The GameViewportClient may consume the event via the CustomNavigationEvent.
The application or a widget can consume the "set focus" event. Resulting in different behavior.
| Name | FSlateNavigationEventSimulator |
| Type | class |
| Header File | /Engine/Source/Developer/SlateReflector/Public/SlateNavigationEventSimulator.h |
| Include Path | #include "SlateNavigationEventSimulator.h" |
Syntax
class FSlateNavigationEventSimulator
Structs
| Name | Remarks |
|---|---|
| FSimulatedReply | |
| FSimulationResult |
Enums
Public
| Name | Remarks |
|---|---|
| ENavigationStyle | |
| ERoutedReason |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FHandleNavigation | TBaseDelegate_TwoParams< TOptional< FWidgetPath >, uint32, const TSharedPtr< SWidget > & > | SlateNavigationEventSimulator.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| OnViewportHandleNavigation | FHandleNavigation | Once the destination widget has been decided, the viewport may handled the event. | SlateNavigationEventSimulator.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TArray< FSimulationResult > Simulate
(
const FWidgetPath& WidgetPath, |
Simulate a navigation event for a widget | SlateNavigationEventSimulator.h | |
FSimulationResult Simulate
(
const FWidgetPath& WidgetPath, |
SlateNavigationEventSimulator.h | ||
TArray< FSimulationResult > SimulateForEachWidgets
(
const FWidgetPath& WidgetPath, |
Simulate for each widgets that are enabled and support keyboard focus | SlateNavigationEventSimulator.h | |
TArray< FSimulationResult > SimulateForEachWidgets
(
const TSharedRef< SWindow >& Window, |
SlateNavigationEventSimulator.h | ||
TArray< FSimulationResult > SimulateForEachWidgets
(
const FWidgetPath& WidgetPath, |
SlateNavigationEventSimulator.h | ||
TArray< FSimulationResult > SimulateForEachWidgets
(
const TSharedRef< SWindow >& Window, |
SlateNavigationEventSimulator.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static FText ToText
(
ENavigationStyle NavigationStyle |
SlateNavigationEventSimulator.h | ||
static FText ToText
(
ERoutedReason RoutedReason |
SlateNavigationEventSimulator.h |