top | item 8455940

(no title)

mstange | 11 years ago

Nightly and Aurora Firefox builds actually support the "code" field on keyboard events, which lets JS know which physical key was pressed on the keyboard. For example, when a Dvorak user presses the key that would be W on a QWERTY layout (for moving forwards in a game), you'll get a keydown event with e.key == "," and e.code == "KeyW".

I'd really like to know what the spec status on that is, and whether other browsers implement it.

discuss

order

ultramancool|11 years ago

Seems like it could be a clever way to solve the issue for players, but probably makes developers on those other keyboards quite miserable.

ErikRogneby|11 years ago

a prompt training the game controls could be quite simple... "PRESS THE KEY YOU EXPECT TO BE UP" step 2: "PRESS THE KEY YOU USE FOR FIRE"