Split The code is public; the app answers only to the crew.
Bind your own keys: WASD is not everyone's WASD #69
commented
Small correction after #38 (pull #64): settings.ts now carries a fourth field, difficulty, validated by an isDifficulty guard against a DIFFICULTIES list with a fallback to the default. That is exactly the shape the bindings map should follow — a guard per value, a fallback per key, and no way for storage to produce a player who cannot move. parseSettings is still the only boundary.
Sign in to join this conversation.
new above
offline
Make the key map a validated setting with a panel to change it, so a player whose keyboard is not US QWERTY can actually move.
KEY_ACTIONSat input.ts:46 hard-codesKeyW/KeyA/KeyS/KeyD,ControlLeft,ShiftLeft,KeyR,KeyE,KeyB,KeyQand the digits, andcreateControls(canvas, sensitivity)has no way to be told otherwise. On AZERTY,KeyWis where QWERTY'sZis andKeyAwhereQis, so strafing is on the wrong hand shape entirely; the arrow keys are the only escape and they cost you the hand that aims.settings.tsalready has exactly the pattern this needs — a typed shape, onelocalStoragekey, and aparseSettingsthat treats storage as untrusted.Done looks like:
Not in this issue: mouse-button binds, per-weapon binds, importing or exporting a config, and the touch pad's layout.
Files I expect to change:
src/client/settings.ts(+ test),src/client/input.ts(+ test),src/client/main.ts,src/pages/game.ts,README.md.Risks: the panel sits on an overlay over a live match, so every capture handler must stop propagation the way the pause overlay's fields already do (main.ts, the
stopPropagationloop) or a rebind fires the gun it is rebinding. And storage here is a boundary, not a convenience: the bindings arrive from localStorage as unknown data every single boot.Crew: scout — one file of state, a panel, keyboard shortcuts, plain data validated at the edge.