Conversation
…e differences pinned Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WcPjTUhFNUMPCdVvQEUMgj
…ed table Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WcPjTUhFNUMPCdVvQEUMgj
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WcPjTUhFNUMPCdVvQEUMgj
… table Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WcPjTUhFNUMPCdVvQEUMgj
|
Review (cold read, The reviewer checked every row of
|
…w, test web GBA routing Answers review findings 1, 2, 3 and 5. An SNES-only key on a web NES joypad is again the page's key (finding 4). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WcPjTUhFNUMPCdVvQEUMgj
|
Answers to the cold review, in
|
…ive tests that read them Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WcPjTUhFNUMPCdVvQEUMgj
|
Review (delta, The reviewer checked all five earlier findings against the code and confirmed each one fixed. The web GB change in finding 4 is documented and has no player-visible effect.
Answer. Fixed in |
…rned two clippy legs red Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WcPjTUhFNUMPCdVvQEUMgj
Bead: nr-tlf. Refactoring: a key bound on desktop is silently missing on the web, which cost nr-use a third failed verification.
What changes
src/platform/key_bindings.rsnow holdsKEY_BINDINGS, the single table of which key drives which console input on which console, in both shells. When one key has several rows, the shell tries them in order and stops at the first the plugged device accepts. For example, W tries the Power Pad, then an SNES pad, then the joypad.controller_mapping.rsholds no bindings of its own any more. It turns a winit key into a table key and applies that key's rows. The Super Scope's 4 and 5 come from the table too.key_binding_table()provides the web rows, andweb/src/input/key_bindings.tsapplies them.keyToButtonController1/2,applyKeyboardMapping,keyboard_mapping.tsandsuperScopeKeyActionare deleted. The page reads the table on the first key event with an emulator loaded. wasm is initialised by then, so the start-up race from nr-di6 does not apply.one_shell_bindings_are_exactly_the_declared_differencespins everyDesktopOnlyandWebOnlyrow.every_web_row_reaches_the_pagethen goes red. On the page,parseKeyBindingTablethrows on such a row.No key changes meaning
Every existing binding is kept, including the many places where the two shells already differed. Each difference is now listed in the pinned test:
-) exists on desktop only.Whether to unify any of these is a player-visible decision for the navigator, and it is not part of this bead.
Small deviations on the web, none of which a player can see:
preventDefaulton keys it ignores. These are the player-2 keys (IJKLOP90), which went to controller 2, which the Game Boy ignores, and Y/G/Q/E, which only had SNES buttons. Neither set did anything before. Keeping the old behaviour would need rows in the table that do nothing.shouldSuppressSnesJoypadInputcheck as player 1. Before, they sent joypad presses to a port holding a Mouse or Super Scope, which that port ignores.Validation
./scripts/gate-full.sh: passed on68182bb9. It covers fmt, all three clippy runs,cargo test --all-features --lib(14619 passed), doctests,wasm-pack testincludingkey_binding_table_has_exactly_the_web_rows, the Python suites, tsc, and Vitest (607 passed).cargo test --all-features --lib key_bindings: passed. These are the table tests../scripts/test-dir.sh src/frontends/native/keyboard: passed. All the existing desktop keyboard tests are unchanged. New sweeps drive every desktop pad row (NES, GB, GBA, SNES), every Power Pad and SNES-pad row with that device plugged in, and the Vs. service key.npx vitest run web/src/input/key_bindings.test.ts: passed (15 tests).Web covered: yes. It is the point of the bead.
🤖 Generated with Claude Code
https://claude.ai/code/session_01WcPjTUhFNUMPCdVvQEUMgj