bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
33.73k stars 3.27k forks source link

Gamepad issue #13625

Open goiw111 opened 1 month ago

goiw111 commented 1 month ago

Bevy version

bevy = { version = "0.13", features = ["dynamic_linking"] }

The release number or commit hash of the version you're using.

The last : https://github.com/bevyengine/bevy/releases/tag/v0.13.2

I used the test from the "gilrs" repo : https://gitlab.com/gilrs-project/gilrs it's giving me this result

DragonRise Inc. Generic USB Joystick is Wired SystemTime { tv_sec: 1717264143, tv_nsec: 686915000 } New event from 0: ButtonPressed(Unknown, Code(EvCode(EvCode { kind: 1, code: 289 }))) SystemTime { tv_sec: 1717264143, tv_nsec: 686915000 } New event from 0: ButtonChanged(Unknown, 1.0, Code(EvCode(EvCode { kind: 1, code: 289 }))) SystemTime { tv_sec: 1717264143, tv_nsec: 822909000 } New event from 0: ButtonReleased(Unknown, Code(EvCode(EvCode { kind: 1, code: 289 }))) SystemTime { tv_sec: 1717264143, tv_nsec: 822909000 } New event from 0: ButtonChanged(Unknown, 0.0, Code(EvCode(EvCode { kind: 1, code: 289 })))

I tested this example and it works for https://bevyengine.org/examples/Tools/gamepad-viewer/

but when I try to receive the "GamepadButtonType::West" event in my code, I got nothing

if button_inputs.just_pressed(GamepadButton::new(pad, GamepadButtonType::West)) { println!("west"); }

Not just the "GamepadButtonType::West" but those also "South,East,North,West".

msvbg commented 2 weeks ago

Check if your gamepad UUID is configured for your OS in here: https://github.com/mdqinc/SDL_GameControllerDB. This is the gamepad database that Bevy ends up depending on in the end, via gilrs.