Skip to content

feat: add a mapping wizard for controllers without a known profile #79

Description

@nextestudios

Summary

Let users map directions, confirm, back and optional buttons on joysticks SDL doesn't know as gamepads. Today such devices are detected but cannot drive the UI.

Motivation

The spec requires unknown controllers to be configurable; a two-button pad must reach every essential function.

Requirements

  • Reads raw buttons, hats and axes; calibrates neutral position, inversion and deadzone; allows redoing each step.
  • Timeout, safe cancel, test mode before saving; never overwrites the only working profile before confirmation.
  • Versioned JSON profiles with import/export, schema and size validation; no executable content.

Controller UX

Wizard driven by the device being mapped, with keyboard fallback.

Technical Notes

Raw joystick events from Sdl3InputBackend; profiles via a new IControllerProfileStore.

Acceptance Criteria

  • A generic joystick can be mapped, saved and used after restart.

Testing

Unit tests for new branches and for every bug reproduced before a fix (no trivial variations, see AGENTS.md). Manual with a generic USB pad.

Dependencies


Priority: high · Milestone: 9 · 1.0 Readiness

Activity

  1. added
    moscow: mustMoSCoW: required for 1.0
    and removed
    priority: highImportant for the controller-first experience
    on Sep 27, 2026
  2. nextestudios commented on Sep 27, 2026

    @nextestudios
    OwnerAuthor

    Implemented in #121 (merged). CI covers everything that can run without a joystick:

    • the wizard state machine: neutral calibration, deadzone, inverted axes, one press per step, refusing reused inputs, skip, redo, timeout, and test mode
    • profile validation, the security boundary for imports: size, depth, unknown or duplicate fields, ranges, and required controls
    • the full journey with simulated raw events: map → test → save → restart → profile applied, with replacement only after confirmation, cancel never touching the saved profile, and import/export

    Still open: the acceptance criterion needs real hardware. A generic USB joystick hasn't been mapped, saved and used after a restart on Windows yet. The checklist is in docs/TESTING.md under "Joystick sem perfil (assistente, #79)", and results go in docs/controller-compatibility.md. I'm leaving this issue open until that manual check has been done.

    Follow-up: a pad with only a D-pad and two buttons can't open Actions or Menu unless those optional steps are mapped. The wizard asks for them first among the optional steps.

  3. nextestudios commented on Sep 27, 2026

    @nextestudios
    OwnerAuthor

    #128: profiles mapped without Actions (North) and/or Menu (Start) now open them by holding Confirm / Back for 0.6 s (short presses unchanged; the bottom bar shows "(segure)" on those glyphs). Covered by a unit test through the real router; still needs a manual check with a real two-button joystick (docs/TESTING.md, "Joystick sem perfil").

  4. nextestudios commented on Sep 27, 2026

    @nextestudios
    OwnerAuthor

    Implementation complete: wizard, profile store and validation (#121), two-button fallback (#128), covered by unit and journey tests with simulated events. The remaining real-joystick verification is tracked in #78 together with the rest of the hardware matrix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: controllerController detection, prompts and mappingarea: inputInput pipeline and routingmoscow: mustMoSCoW: required for 1.0type: featureNew capability

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions