File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
framework_crates/bones_framework/src/input Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,28 @@ pub fn process_gamepad_events() -> GamepadInputs {
5555 } ,
5656 ) ) ;
5757 }
58+ EventType :: ButtonPressed ( gilrs_button, _) => {
59+ if let Some ( button) = convert_button ( gilrs_button) {
60+ gamepad_inputs
61+ . gamepad_events
62+ . push ( GamepadEvent :: Button ( GamepadButtonEvent {
63+ gamepad,
64+ button,
65+ value : 1.0 ,
66+ } ) ) ;
67+ }
68+ }
69+ EventType :: ButtonReleased ( gilrs_button, _) => {
70+ if let Some ( button) = convert_button ( gilrs_button) {
71+ gamepad_inputs
72+ . gamepad_events
73+ . push ( GamepadEvent :: Button ( GamepadButtonEvent {
74+ gamepad,
75+ button,
76+ value : 0.0 ,
77+ } ) ) ;
78+ }
79+ }
5880 EventType :: ButtonChanged ( gilrs_button, value, _) => {
5981 if let Some ( button) = convert_button ( gilrs_button) {
6082 gamepad_inputs
You can’t perform that action at this time.
0 commit comments