We had an interesting bug at the company I work on: we have an application with lots of key shortcuts, including "`" (backtick character), and because KeyboardEvent.keyCode has been deprecated, it was changed on a refactor from
KeyboardEvent.keyCode === 192
to
KeyboardEvent.key === '`'
This works on keyboards without diacritics activated - for instance, US keyboard with no diacritics where pressing the ` key would immediately write the ` character - while for users with diacritics activated, it would not (on such cases, to type the ` one needs to press the ` key then space), because if you press the key ` and then the letter a, for instance, you get the character à. Apparently with diacritics activated, KeyboardEvent.key returns Dead, so we had to revert this refactor.
That being said, is there a different option then using this deprecated feature?
You can use KeyboardEvent.code
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code