playcanvas / pcui

UI component library for web-based tools
http://playcanvas.github.io/pcui
MIT License
663 stars 62 forks source link

Migrate key event handlers to use `key` instead of `keyCode` #209

Closed willeastcott closed 1 year ago

willeastcott commented 1 year ago

KeyboardEvent.keyCode is deprecated.

image

Instead, it is recommended to use KeyboardEvent.key instead. This PR migrates all occurrences of keyCode with key. It is better since key values are human readable.

Note that KeyboardEvent.key now has 98.32% browser support: https://caniuse.com/keyboardevent-key