Exide / top-down-arena-shooter

MIT License
0 stars 0 forks source link

The Web API KeyboardEvent.keyCode property is deprecated #58

Open Exide opened 6 years ago

Exide commented 6 years ago

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

This feature has been removed from the Web standards. Though some browsers may still support it, it is in the process of being dropped. Avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

Shouldn't be too difficult to replace keyCode with code.

Web developers shouldn't use the keyCode attribute for printable characters when handling keydown and keyup events. As described above, the keyCode attribute is not useful for printable characters, especially those input with the Shift or Alt key pressed. When implementing a shortcut key handler, the keypress event is usually better (at least when Gecko is the runtime in use). See Gecko Keypress Event for details.

I should probably looking into keypress events.