Arrow-key / gamepad focus traversal between focusable elements in a panel — Unity's built-in focus ring. Luna's role is to keep it usable when multiple views are layered: by auto-disabling the interactable elements of views underneath the active one, the focus ring can't wander off into hidden UI.
Not to be confused with Navigation, Luna's screen push/pop stack. Focus Navigation = arrow keys moving the highlight between buttons within a view. Navigation = pushing a new view onto the stack.
See the Disable Other Views On FadeIn field in UIView or UIViewComponent.
Each UI Toolkit panel features a focus ring that determines the focus order of elements. You can learn more about this feature here:
Unity: Dispatch Events (opens in new tab)
You can manually determine what element is focused next.
myVisualElement.RegisterCallback<NavigationMoveEvent>(e =>
{
switch(e.direction)
{
case NavigationMoveEvent.Direction.Up: U.Focus(); break;
case NavigationMoveEvent.Direction.Down: D.Focus(); break;
case NavigationMoveEvent.Direction.Left: L.Focus(); break;
case NavigationMoveEvent.Direction.Right: R.Focus(); break;
}
e.StopPropagation(); // Prevent further processing of the event
myVisualElement.focusController.IgnoreEvent(e); // Prevent default navigation
});Settings
Theme
Light
Contrast
Material
Dark
Dim
Material Dark
System
Sidebar(Light & Contrast only)
Font Family
DM Sans
Wix
Inclusive Sans
AR One Sans
Direction