Rebind keys per seat for two-player modes

未關閉
#112 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
55/100
Issue 類型
功能
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
typescript, vite
領域
frontend, game-dev

研究方向

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.

由索引模型根據 Issue 內容生成。

描述

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

主要語言
TypeScript
星號
3
分支
3
平均合併
10 小時 22 分鐘
30 天內合併 PR
6

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

TMHSDigital/GH-Arcade 的其他 Issue

查看 TMHSDigital/GH-Arcade 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。