MCPcopy Create free account
hub / github.com/PerroEngine/Perro / sync_axes

Method sync_axes

perro_source/render_stack/perro_app/src/input/gamepad.rs:464–489  ·  view source on GitHub ↗
(&mut self, app: &mut S, gilrs: &Gilrs)

Source from the content-addressed store, hash-verified

462 continue;
463 }
464 for button in ALL_BUTTONS {
465 let Some(gilrs_button) = map_button_to_gilrs(button) else {
466 continue;
467 };
468 let is_down = gp.is_pressed(gilrs_button);
469 self.set_button(app, gilrs, id, button, is_down);
470 }
471 }
472 }
473
474 fn sync_axes<S: GamepadSink>(&mut self, app: &mut S, gilrs: &Gilrs) {
475 self.sync_ids.clear();
476 self.sync_ids.extend(self.id_to_uuid.keys().copied());
477 for id in self.sync_ids.iter().copied() {
478 let gp = gilrs.gamepad(id);
479 if !gp.is_connected() || is_joycon(&gp) {
480 continue;
481 }
482 let Some(index) = self
483 .id_to_uuid
484 .get(&id)
485 .and_then(|u| self.uuid_to_index.get(u))
486 .copied()
487 else {
488 continue;
489 };
490 for axis in ALL_AXES {
491 let Some(gilrs_axis) = map_axis_to_gilrs(axis) else {
492 continue;

Callers 1

begin_frameMethod · 0.80

Calls 8

is_joyconFunction · 0.85
map_axis_to_gilrsFunction · 0.85
extendMethod · 0.80
log_raw_like_stateMethod · 0.80
clearMethod · 0.45
iterMethod · 0.45
getMethod · 0.45
set_gamepad_axisMethod · 0.45

Tested by

no test coverage detected