语言

Menu
Sites
Language
Bug: Simulator remote's KeyboardEvent missing key property

 

When pressing buttons on the simulator's remote, the KeyboardEvent is missing the key and code properties. These are implemented since Chrome 51 and 48 respectivelty. Consequently any modern code in event listeners depending on these proprties instead of the deprecated `keyCode` will not react to `keydown` events.

The emulator's remote does populate these properties, as well as the deprecated keyCode.

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

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