(&mut self, app: &mut S, gilrs: &Gilrs)
| 444 | &mut self, |
| 445 | app: &mut S, |
| 446 | gilrs: &Gilrs, |
| 447 | id: GamepadId, |
| 448 | button: Button, |
| 449 | value: f32, |
| 450 | ) { |
| 451 | let axis = match button { |
| 452 | Button::LeftTrigger2 => Some(GamepadAxis::LeftTrigger), |
| 453 | Button::RightTrigger2 => Some(GamepadAxis::RightTrigger), |
| 454 | _ => None, |
| 455 | }; |
| 456 | let Some(axis) = axis else { |
| 457 | return; |
| 458 | }; |
| 459 | let Some(index) = self.assign_index_if_unique(gilrs, id) else { |
| 460 | return; |
| 461 | }; |
| 462 | app.set_gamepad_axis(index, axis, value.clamp(0.0, 1.0)); |
| 463 | } |
| 464 | |
| 465 | fn assign_index_if_unique(&mut self, gilrs: &Gilrs, id: GamepadId) -> Option<usize> { |
no test coverage detected