Repository navigation
Eon Commando 2.6.0 — rebindable controls
Every key is rebindable, per player, and it sticks.
Settings → Controls (O, then Enter). Up/down picks an action, Enter starts listening and the next key you press is bound, R resets that player, left/right switches between player one and player two.
The interesting part
Bindings used to be two hardcoded keycode maps. They're now a data table per player, persisted in localStorage, with a reverse map rebuilt on every change. That matters for three reasons:
- Binding a key steals it. Bind
Qto fire andQis removed from whatever else used it — the previous owner falls back to its default rather than silently becoming unbound. That's the failure mode most rebinding screens ship with. - Player two is rebindable too.
WASD+,./;'are now defaults, not a hardcoded second map, so co-op follows your bindings. - Gamepad flows through the same table, so a future pad-rebind is a UI change, not an engine change.
Verified end to end: rebinding jump to Q makes X stop jumping and Q start; the change survives a save/reload; stealing works both directions; reset restores defaults; player two's bindings stay independent of player one's.
Not done, deliberately
On-screen touch buttons are still fixed-position. Rebinding covers keyboard and gamepad. A touch layout editor — drag the pads anywhere, per device — is a separate job and a bigger one, because it needs its own persistence and a preview. I'd rather ship keyboard rebinding now than half of both.
Numbers
| Game | index.html — 167 KB, single file |
| Gzipped | 46 KB |
| Rebindable actions | 9 per player, 2 players |
| Dependencies | 0 |
Full notes in CHANGELOG.md.
