Game code asks about 'confirm', never about 'Enter'. That indirection is what makes
rebinding possible at all, and it is far easier to put in from the start than to retrofit
once a hundred call sites know about key codes.
Keys are identified by KeyboardEvent.code (the physical key), so a binding to KeyZ
lands on the same place under AZERTY as under QWERTY, which is what a player actually
wants from a movement key.
Keyboard input, bound to named actions.
Game code asks about
'confirm', never about'Enter'. That indirection is what makes rebinding possible at all, and it is far easier to put in from the start than to retrofit once a hundred call sites know about key codes.Keys are identified by
KeyboardEvent.code(the physical key), so a binding toKeyZlands on the same place under AZERTY as under QWERTY, which is what a player actually wants from a movement key.