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

Function is_joycon

perro_source/render_stack/perro_app/src/input/gamepad.rs:625–636  ·  view source on GitHub ↗
(gp: &gilrs::Gamepad<'_>)

Source from the content-addressed store, hash-verified

623 fn log_gamepad_connected(gilrs: &Gilrs, id: GamepadId, index: usize) {
624 let gp = gilrs.gamepad(id);
625 let name = gp.name();
626 let vendor = gp.vendor_id();
627 let product = gp.product_id();
628 let idx = GamepadIndex(index);
629 eprintln!(
630 "[gamepad] connected index={:?} name=\"{}\" vid={:?} pid={:?}",
631 idx, name, vendor, product
632 );
633 }
634
635 fn is_joycon(gp: &gilrs::Gamepad<'_>) -> bool {
636 let Some(vendor) = gp.vendor_id() else {
637 return false;
638 };
639 let Some(product) = gp.product_id() else {

Callers 5

handle_eventMethod · 0.85
sync_buttonsMethod · 0.85
sync_axesMethod · 0.85
log_raw_like_stateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected