Function bevy_ui_navigation::systems::generic_default_mouse_input
source · pub fn generic_default_mouse_input<T: ScreenSize + Component>(
input_mapping: Res<'_, InputMapping>,
primary_window: Query<'_, '_, &Window, With<PrimaryWindow>>,
mouse: Res<'_, Input<MouseButton>>,
focusables: NodePosQuery<'_, '_, T>,
focused: Query<'_, '_, Entity, With<Focused>>,
nav_cmds: EventWriter<'_, NavRequest>,
last_pos: Local<'_, Vec2>
)
Expand description
A generic system to send mouse control events to the focus system
T
must be a component assigned to Focusable
elements that implements
the ScreenSize
trait.
Which button to press to cause an action event is specified in the
InputMapping
resource.
You may however need to customize the behavior of this system (typically
when integrating in the game) in this case, you should write your own
system that sends NavRequest
events. You may use
ui_focusable_at
to tell which focusable is currently being hovered.