Why Nostr? What is Njump?
2024-07-23 21:08:09

Sim on Nostr: If you're making a JavaScript game that takes keyboard input, please use the ...

If you're making a JavaScript game that takes keyboard input, please use the KeyboardEvent.code attribute (instead of .key).

https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code

> this property returns a value that isn't altered by keyboard layout or the state of the modifier keys.

Your players who don't use a QWERTY layout will thank you.

#javascript #gamedev
Author Public Key
npub1n7am4h06d2uc6a25f9ccka4pgyls7yvynwuyw4whpluszrzjas0qcqk50l