Expand description
A UI-centric focus system for Bevy.
This crate provides a system for managing input focus in Bevy applications, including:
InputFocus, a resource for tracking which entity has input focus.- Methods for getting and setting input focus via
InputFocusandIsFocusedHelper. - Events for when entities gain or lose focus:
FocusGainedandFocusLost. - A generic
FocusedInputevent to send input events which bubble up from the focused entity. - Various navigation frameworks for moving input focus between entities based on user input, such as
tab_navigationanddirectional_navigation.
This crate does not provide any integration with UI widgets: this is the responsibility of the widget crate,
which should depend on bevy_input_focus.
Modules§
- directional_
navigation - A manual navigation framework for moving between focusable elements based on directional input.
- navigator
- Functions used by navigators to determine where to go next.
- tab_
navigation - This module provides a framework for handling linear tab-key navigation in Bevy applications.
Structs§
- Acquire
Focus - An event which is used to set input focus. Trigger this on an entity, and it will bubble until it finds a focusable entity, and then set focus to it.
- Auto
Focus - Indicates that this widget should automatically receive
InputFocus. - Focus
Gained - An
EntityEventthat is sent when an entity gainsInputFocus. - Focus
Lost - An
EntityEventthat is sent when an entity losesInputFocus. - Focused
Input - A bubble-able user input event that starts at the currently focused entity.
- Input
Dispatch Plugin - Plugin which sets up systems for dispatching bubbling keyboard and gamepad button events to the focused entity.
- Input
Focus - Resource representing which entity has input focus, if any. Input events (other than pointer-like inputs) will be dispatched to the current focus entity, or to the primary window if no entity has focus.
- Input
Focus Plugin - Plugin which sets up the core input focus system.
- Input
Focus Visible - Resource representing whether the input focus indicator should be visible on UI elements.
- IsFocused
Helper - A system param that helps get information about the current focused entity.
- Window
Traversal - These are for accessing components defined on the targeted entity
- Window
Traversal Item - Automatically generated
WorldQueryitem type forWindowTraversal, returned when iterating over query results.
Enums§
- Focus
Cause - The cause for a
FocusGained - Input
Focus Systems - System sets for
bevy_input_focus.
Traits§
- IsFocused
- Trait which defines methods to check if an entity currently has focus.
Functions§
- dispatch_
focused_ input - System which dispatches bubbled input events to the focused entity, or to the primary window if no entity has focus.
- process_
recorded_ focus_ changes - Reads the recorded focus changes from the
InputFocusresource and sends the appropriateFocusGainedandFocusLostevents. - set_
initial_ focus - If no entity is focused, sets the focus to the primary window, if any.