Rebind keys per seat for two-player modes

Đang mở
#112 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript, vite
Lĩnh vực
frontend, game-dev

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
TypeScript
Star
3
Fork
3
Merge trung bình
10 giờ 22 phút
Pull request đã merge (30 ngày)
6

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của TMHSDigital/GH-Arcade

Tất cả issue của TMHSDigital/GH-Arcade

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.