bevy_input::gamepad

Function gamepad_connection_system

Source
pub fn gamepad_connection_system(
    commands: Commands<'_, '_>,
    connection_events: EventReader<'_, '_, GamepadConnectionEvent>,
)
Expand description

Handles GamepadConnectionEvents events.

On connection, adds the components representing a Gamepad to the entity. On disconnection, removes the Gamepad and other related components. Entities are left alive and might leave components like GamepadSettings to preserve state in the case of a reconnection

ยงNote

Whenever a Gamepad connects or disconnects, an information gets printed to the console using the info! macro.