Skip to content

feat: detect the active controller family (Xbox, PlayStation, Nintendo, generic) - #111

Merged
nextestudios merged 1 commit into
mainfrom
feature/32-controller-family
Sep 27, 2026
Merged

nextestudios merged 1 commit into
mainfrom
feature/32-controller-family

Conversation

@nextestudios

Copy link
Copy Markdown
Owner

Summary

  • ControllerFamily (Core) + ControllerFamilies.Detect(isGamepad, sdlType, vendorId): SDL gamepad type first (xbox360/xboxone, ps3/ps4/ps5, switchpro/joycon*/gamecube), then vendor ID (Microsoft/Sony/Nintendo) when SDL reports standard/unknown; joysticks without a gamepad profile are Generic. No device-name matching.
  • InputDeviceInfo.Family is set by Sdl3InputBackend; InputHost publishes the active family to AppController.SetActiveController on every ActiveDeviceChanged.
  • Hot swap: InputRouter now lets another device take over with a new press when the active one isn't holding anything (and never while a sensitive modal is open). This avoids two pads fighting and double actions from a physical+virtual pair.
  • Settings: ButtonLabelStyle.Automatic (new default) follows the active family; Generic/Xbox/PlayStation/Nintendo still pin a style from the menu. Settings schema v2: v1 files whose LabelStyle was the old Generic default migrate to Automatic; explicit choices stay.
  • Footer glyphs use AppController.PromptFamily (vector glyphs and the prompt provider come in feat: create original vector button glyphs for Xbox, PlayStation, Nintendo and generic layouts #33/feat: add dynamic controller button prompts to action bar #34).
  • InputProbe prints the detected family.

Tests

  • CI (unit): family mapping per SDL type/vendor, manual override vs automatic, v1 → v2 settings migration, router takeover rules (replaces the old "only the first device ever drives the UI" test).
  • Manual (docs/TESTING.md, docs/controller-compatibility.md): real Xbox/DualSense/Switch Pro report the expected family; hot swap Xbox → DualSense switches labels without restart.

Closes #32

🤖 Generated with Claude Code

Resolve Xbox/PlayStation/Nintendo/Generic from the SDL gamepad type and
vendor ID, publish it from InputHost to AppController, and let another
controller take over with a new press while the active one is idle.
Label style gains "Automatic" (new default; v1 settings that only had the
old Generic default migrate to it); manual styles still override.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@nextestudios
nextestudios force-pushed the feature/32-controller-family branch from c5dda6a to 9d810e6 Compare September 27, 2026 02:40
@nextestudios
nextestudios merged commit 5530367 into main Sep 27, 2026
1 check passed
@nextestudios
nextestudios deleted the feature/32-controller-family branch September 27, 2026 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: detect the active controller family (Xbox, PlayStation, Nintendo, generic)

1 participant