debug gamepad button

This commit is contained in:
2025-03-19 23:14:29 +01:00
parent 6c2525cc1c
commit b4013b4eb0

View File

@@ -149,10 +149,6 @@ fn mouse_click(mut events: EventReader<MouseButtonInput>, mut commands: Commands
fn gamepad_connections(mut evr_gamepad: EventReader<GamepadEvent>) { fn gamepad_connections(mut evr_gamepad: EventReader<GamepadEvent>) {
for ev in evr_gamepad.read() { for ev in evr_gamepad.read() {
// we only care about connection events
let GamepadEvent::Connection(ev_conn) = ev else {
continue;
};
match ev { match ev {
GamepadEvent::Connection(connection) => match &connection.connection { GamepadEvent::Connection(connection) => match &connection.connection {
GamepadConnection::Connected { GamepadConnection::Connected {
@@ -162,11 +158,11 @@ fn gamepad_connections(mut evr_gamepad: EventReader<GamepadEvent>) {
} => { } => {
info!( info!(
"New gamepad connected: {:?}, name: {name}, vendor: {vendor_id:?}, product: {product_id:?}", "New gamepad connected: {:?}, name: {name}, vendor: {vendor_id:?}, product: {product_id:?}",
ev_conn.gamepad connection.gamepad,
); );
} }
GamepadConnection::Disconnected => { GamepadConnection::Disconnected => {
info!("Lost connection with gamepad: {:?}", ev_conn.gamepad); info!("Lost connection with gamepad: {:?}", connection.gamepad);
} }
}, },
GamepadEvent::Button(gamepad_button_changed_event) => { GamepadEvent::Button(gamepad_button_changed_event) => {