pub fn default_mouse_input(
    input_mapping: Res<'_, InputMapping>,
    windows: Res<'_, Windows>,
    mouse: Res<'_, Input<MouseButton>>,
    touch: Res<'_, Touches>,
    focusables: NodePosQuery<'_, '_, Node, UiCamera>,
    names: Query<'_, '_, (Entity, &Camera)>,
    focused: Query<'_, '_, Entity, With<Focused>>,
    cmds: Commands<'_, '_>,
    nav_cmds: EventWriter<'_, '_, NavRequest>,
    last_pos: Local<'_, Vec2>
)
Expand description

A system to send mouse control events to the focus system

Unlike generic_default_mouse_input, this system is gated by the bevy-ui feature. It relies on bevy/render specific types: bevy::render::Camera and bevy::ui::Node.

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.