Skip to content

fix: two-button pads reach Actions and Menu - #128

Merged
nextestudios merged 1 commit into
mainfrom
feature/79-two-button-fallback
Sep 27, 2026
Merged

nextestudios merged 1 commit into
mainfrom
feature/79-two-button-fallback

Conversation

@nextestudios

Copy link
Copy Markdown
Owner

Summary

The spec says a two-button pad must reach every essential function, but a joystick profile mapped with only directions + confirm + back (all optional steps skipped in the #79 wizard) could not open Actions or Menu.

  • New LongPressFallback / LongPressTranslator (Core): for profiles lacking North and/or Start only, the profile's Confirm/Back controls are delayed to release. A short press emits the same button as before; held for 0.6 s they emit one North (→ Actions) / Start (→ Menu) press, and the release emits nothing. Follows the confirm/back convention. Gamepads and profiles that map North/Start are unchanged.
  • InputHost runs profiled controls through it (ticked in the input loop, rebuilt on profile or convention changes) and publishes the active device's fallback to AppController.SetLongPressFallback.
  • Bottom bar: for such a device, Actions/Menu prompts are drawn on the Confirm/Back glyph with "(segure)" (e.g. A Ações (segure)).
  • Known trade-off (documented): on these pads, holding South on ⌫ ◀ ▶ in the on-screen keyboard no longer repeats. The controller test screen (feat: in-app controller test screen #127) shows the plain profile controls without the fallback.
  • Docs: input-and-focus.md, GUIDE pair, TESTING.md manual check, both changelogs.

Tests

  • CI: new unit test in ControllerMappingWizardTests feeds raw events through the real ControllerProfileTranslator → LongPressTranslator → InputRouter: short Confirm/Back/direction unchanged; held 0.6 s → OpenContextMenu and OpenAppMenu once, no Confirm/Back on release; a profile with North/Start gets no fallback.
  • Manual (needs a real two-button joystick, in docs/TESTING.md): timing feel, prompts on screen.

Refs #79

🤖 Generated with Claude Code

A profile mapped with only directions, confirm and back could not open
Actions or Menu. For profiles lacking North and/or Start, holding Confirm
for 0.6 s now opens Actions and holding Back opens the Menu; short presses
are unchanged (they fire on release). The bottom bar shows these on the
Confirm/Back glyphs with "(segure)" for such devices.

Refs #79

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nextestudios
nextestudios merged commit 8730255 into main Sep 27, 2026
1 check passed
@nextestudios
nextestudios deleted the feature/79-two-button-fallback branch September 27, 2026 03:48
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.

1 participant