Skip to content

fix(v2): stop gamepad B/cancel from backing out of controller test and games#3604

Open
gantoine wants to merge 1 commit into
masterfrom
claude/github-issue-3591-gedicl
Open

fix(v2): stop gamepad B/cancel from backing out of controller test and games#3604
gantoine wants to merge 1 commit into
masterfrom
claude/github-issue-3591-gedicl

Conversation

@gantoine

@gantoine gantoine commented Jun 25, 2026

Copy link
Copy Markdown
Member

The global useGamepad loop translated every button into a built-in action regardless of context. On the controller-test screen this meant pressing B (or Circle / Nintendo-A, which share the standard B index) fired "back" and left the page before the press could be inspected. The same happened while a game was running: the emulator owns the pad, but useGamepad still ran "back" on B and quit the game.

Suppress the built-in translation in two contexts:

  • While a game is running (storePlaying.playing), so the emulator owns the pad entirely.
  • On the controller-test route, so every button can be pressed and inspected in place.

Because the test screen no longer exits on B, ControllerDebug owns its own escape: hold a back button (B / Circle or Back / Share) for 700ms to navigate away, with an on-screen hint and a fill indicator. A short tap just registers in the inspector.

Fixes #3591

Claude-Session: https://claude.ai/code/session_01EdiAR2HMM5pCMVfn2Zhbrx

Description
Explain the changes or enhancements you are proposing with this pull request.

Checklist
Please check all that apply.

  • I've tested the changes locally
  • I've updated relevant comments
  • I've assigned reviewers for this PR
  • I've added unit tests that cover the changes

Screenshots (if applicable)

…d games

The global useGamepad loop translated every button into a built-in
action regardless of context. On the controller-test screen this meant
pressing B (or Circle / Nintendo-A, which share the standard B index)
fired "back" and left the page before the press could be inspected. The
same happened while a game was running: the emulator owns the pad, but
useGamepad still ran "back" on B and quit the game.

Suppress the built-in translation in two contexts:
- While a game is running (storePlaying.playing), so the emulator owns
  the pad entirely.
- On the controller-test route, so every button can be pressed and
  inspected in place.

Because the test screen no longer exits on B, ControllerDebug owns its
own escape: hold a back button (B / Circle or Back / Share) for 700ms to
navigate away, with an on-screen hint and a fill indicator. A short tap
just registers in the inspector.

Fixes #3591

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EdiAR2HMM5pCMVfn2Zhbrx
@gantoine gantoine changed the title fix(v2): stop gamepad B/cancel from backing out of controller test an… fix(v2): stop gamepad B/cancel from backing out of controller test and games Jun 25, 2026
@gantoine

gantoine commented Jun 25, 2026

Copy link
Copy Markdown
Member Author

@zurdi15 claude took a crack at #3591, i no longer have a usb gamepad, can you test this one and push changes if needed?

@zurdi15

zurdi15 commented Jun 25, 2026

Copy link
Copy Markdown
Member

@zurdi15 claude took a crack at #3591, i no longer have a usb gamepad, can you test this one and push changes if needed?

Sure I'll approve once I can review it

@gantoine gantoine requested a review from zurdi15 June 25, 2026 23:12
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.

[Bug] 5.0.0-alpha 1 Controller testing backs out

3 participants