Rebound keys are ignored on some screens and conflicts are accepted

Aberta
#7 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
78/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
typescript
Domínio
frontend, game-dev

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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

Linguagem predominante
TypeScript
Estrelas
3
Forks
3
Métricas de merge de PRs
Nenhum PR com merge em 30d

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de TMHSDigital/GH-Arcade

Todas as issues de TMHSDigital/GH-Arcade

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.