Rebind keys per seat for two-player modes

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

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

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

Direzione di ricerca

Start with PLAYER_KEYS and resolveDefaults in shared/controls.ts, then read the sanitizing and clash handling in shared/settings.ts (around lines 239-255). The settings panel is in src/hub/settings-panel.ts, and shared/settings.test.ts is where the new tests belong. Run npm test; done means seat bindings persist, can be changed and restored on the hub, and clash checks cover them.

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

Descrizione

enhancement help wanted severity: low

Summary

Let players rebind the keyboard keys for player 1 and player 2 in two-player modes.

Where

  • shared/controls.ts:42-49 (PLAYER_KEYS: WASD + Space/Shift, arrows + Enter/Ctrl)
  • shared/controls.ts:97-115 (resolveDefaults ignores custom bindings for seats, except Pause and Mute)
  • shared/settings.ts:239-255 (clash handling covers only Pause and Mute)

Details

The two keyboard halves are fixed. The gamepad rebinding work (#71) deliberately left per-seat keys out.

Proposal

Add seatBindings: { 1?: ..., 2?: ... } to Settings (sanitized like bindings), have resolveDefaults prefer it over PLAYER_KEYS, add a "Player 1 / Player 2 keys" section to the hub settings panel that reuses the existing capture and clash checks, and include seat keys in the clash set sharedKeyCodes uses.

Who benefits

Players on non-QWERTY layouts (AZERTY moves A and W), laptops without a right Ctrl, or keyboards that drop some key combinations, in Snake versus, Pong versus and Siege co-op.

Acceptance criteria

  • Each seat's keys can be changed and restored on the hub.
  • shared/settings.test.ts covers sanitizing and clashes for seat bindings.

Getting started

  • Relevant files: shared/controls.ts, shared/settings.ts, src/hub/settings-panel.ts
  • How to run tests: npm test
  • Related: #63, #71

Filed by repo-audit/full-audit at de2b25b. Severity: low. Effort: M. audit-key: enhancement|shared/controls.ts|PLAYER_KEYS

Lingua principale
TypeScript
Stelle
3
Fork
3
Merge medio
10h 22m
PR unite (30g)
6

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.