Commit Graph

3 Commits

Author SHA1 Message Date
1jamie 1f6ad5a104 fix(input): isolate analog stick rebinds and make right stick neutral by default
- Remove right stick directions (rightstick_* and rs*) from STICK_DEFAULT_BINDINGS so RS is neutral out of the box
- Pre-compile effectiveStickBindings table in Input:applyBindings to maintain an O(1) polling path in gamepadpressed:
  - Suppress competing LS directional defaults when RS is explicitly mapped to movement
  - Suppress LS directional defaults when LS is rebound to arbitrary actions (normalizing both long and short aliases)
  - Preserve LS analog movement when cardinal directions are mapped to D-Pad or face buttons
- Symmetrically evict active virtual stick sources and reset stick directions in applyBindings to avoid stuck-high inputs during rebinds
- Update sdl_controller_support_test.lua for default RS neutrality
- Add stick_rebind_isolation_test.lua covering default neutrality, rebind isolation, alias normalization, and eviction
2026-10-13 15:43:51 -05:00
bryanthaboi 07f9f8796c PR #2716: raw joysticks read axes 1/2 only, speed rows show 0/1, strip comments 2026-10-06 20:00:34 -04:00
Shane McGovern 1a53525722 feat(input): full SDL controller support and analog rebinds in Options
- Add normalizePad() and aliases in GamepadMap for triggers and sticks
- Automatically load custom mappings from SDL_GAMECONTROLLERCONFIG and gamecontrollerdb.txt
- Add support for left and right analog sticks, triggers (L2/R2), stick clicks (LS/RS), and extra SDL buttons (Guide, Touchpad, Paddles)
- Route analog stick axis thresholds into discrete directional press/release events for seamless in-game and menu navigation
- Support rebinding buttons, thumbstick directions, triggers, and stick clicks in the CONTROLS menu (BindingsMenu) with clear abbreviated labels (LS-UP, RS-DN, L2, R2, etc.)
- Integrate stick axis event dispatch across Gen1, Gen2, and Gen3 game loops
- Add comprehensive test suite in tests/engine/sdl_controller_support_test.lua covering all axes, buttons, holds, rebinding, and multi-generation routing
2026-10-06 16:56:38 +01:00