mirror of
https://github.com/rommapp/romm.git
synced 2026-11-29 10:01:00 +01:00
The v2 gamepad polling loop reads buttons and axes by hardcoded W3C standard-mapping indices, but only guarded against null pads. Firefox (and Zen) expose phantom or non-standard-mapping gamepads even with no real controller attached, whose analog controls drift across the press threshold. Index 4/5 (LB/RB) are bound to AppNav section cycling, so each oscillation re-fired cycleSection and looped the app through home/platforms/collections/search with no user input, making the UI unusable. Add an isUsablePad() guard requiring pad.connected and a "standard" mapping, applied in both the polling loop and detectPadPresence. Every button/axis read assumes the standard mapping, so a non-standard pad cannot be interpreted safely regardless. Fixes #3851 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>