Follow-up from PR #110 review.
_list_gamepads() (inputs/impl/usb_joystick.py:96) orders devices by evdev.list_devices(), which returns /dev/input/event* paths in alphabetical order. That ordering is not stable across reboots/replugs — today's joystick_device=0 can be tomorrow's joystick_device=1 after a hot-plug or a USB-hub reshuffle.
For a single-controller setup it's fine. For multi-controller setups, or any deployment where the controller is hot-plugged, it's a footgun.
Proposed config addition — optional joystick_device_id: str = \"\" field with this match order:
dev.uniq exact match (when populated, this is the closest evdev equivalent of a serial / BT MAC)
- fall back to
dev.name substring match
- fall back to current
joystick_device integer index
That keeps existing behavior the default while giving deployments a stable handle.
Also worth a docstring note on _list_gamepads() that requiring ABS_RX excludes single-stick / flight-style controllers — gamepad-only by design.
Out of scope for #110.
Follow-up from PR #110 review.
_list_gamepads()(inputs/impl/usb_joystick.py:96) orders devices byevdev.list_devices(), which returns/dev/input/event*paths in alphabetical order. That ordering is not stable across reboots/replugs — today'sjoystick_device=0can be tomorrow'sjoystick_device=1after a hot-plug or a USB-hub reshuffle.For a single-controller setup it's fine. For multi-controller setups, or any deployment where the controller is hot-plugged, it's a footgun.
Proposed config addition — optional
joystick_device_id: str = \"\"field with this match order:dev.uniqexact match (when populated, this is the closest evdev equivalent of a serial / BT MAC)dev.namesubstring matchjoystick_deviceinteger indexThat keeps existing behavior the default while giving deployments a stable handle.
Also worth a docstring note on
_list_gamepads()that requiringABS_RXexcludes single-stick / flight-style controllers — gamepad-only by design.Out of scope for #110.