Rebound keys are ignored on some screens and conflicts are accepted

Aperta
#7 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
frontend, game-dev

Direzione di ricerca

Start with shared/ui.ts, shared/settings.ts, shared/pause.ts and src/hub/settings-panel.ts, then trace the named onStart and Snake GameScene.ts call sites. Check how ArcadeControls and default bindings are represented before following the current menu prompts and rebinding capture flow. Run npm run typecheck and npm run build; done means rebound Action works across menus and prompts, prompts show the current key, and duplicate bindings are not silently accepted.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug severity: medium

Summary

Custom key bindings are honoured by ArcadeControls and OptionMenu but not by onStart, raw key listeners or on-screen prompts. The rebinding dialog also accepts a key that is already used by another action.

Where

  • shared/ui.ts:48-51 (keydown-SPACE / keydown-ENTER hard-coded)
  • shared/scenes.ts:68-69, shared/pause.ts:62, shared/pause.ts:124 (literal prompt strings)
  • games/snake/scenes/GameScene.ts:393-398
  • src/hub/settings-panel.ts:82-97 (capture with no clash check), src/hub/settings-panel.ts:103 (reset clears every binding)

Impact

After rebinding Action, menus built with modes need the new key while plain menus still need Space or Enter, and hints name keys that no longer work. Binding one key to two actions makes one press fire both. Fixing one mistake means resetting all bindings.

Steps to reproduce

  1. Hub Settings: change Action to K.
  2. Open Breakout: K does not start the game and the prompt still says SPACE.
  3. Open Pong: K selects a mode and Space does nothing.

Suggested fix

  • Have onStart take an ArcadeControls (or read the action binding from settings).
  • Add a keyLabel(action) helper and use it in prompts.
  • In the settings panel, detect a clash against other actions' custom and default keys and swap or warn; reject Tab and bare modifiers; add a per-row "Default" button.

Acceptance criteria

  • A rebound Action key works on every menu, start prompt and rematch screen
  • Prompts show the current binding
  • The dialog does not silently accept a duplicate key

Getting started

  • Relevant files: shared/ui.ts, shared/settings.ts, src/hub/settings-panel.ts, shared/pause.ts
  • Run locally: npm install, then npm run dev
  • Checks: npm run typecheck and npm run build (there is no test suite yet)
  • Related docs: README.md

Related: #1


Filed by repo-audit/full-audit at b001f5d. Severity: medium. Effort: M. audit-key: bug|shared/ui.ts|onStart

Lingua principale
TypeScript
Stelle
3
Fork
3
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TMHSDigital/GH-Arcade

Tutte le issue di TMHSDigital/GH-Arcade

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.