Rebind keys per seat for two-player modes

Abierto
#112 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
55/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript, vite

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
TypeScript
Estrellas
3
Forks
3
Merge medio
10 h 22 min
PR fusionados (30 d)
6

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de TMHSDigital/GH-Arcade

Todos los issues de TMHSDigital/GH-Arcade

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.