Mozilla developer network has marked KeyboardEvent.which to be deprecated and nonstandard, even though most browsers have implemented it (albeit in an non-unified fashion).
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/which
Considerations:
keyCode and charCode are also both deprecated, with inconsistent browser support.
key is current and standard, however it does all the work that we're doing to take into account shift, locale, etc.
keyIdentifier seems to be a highly unimplemented and nonstandard stunt pulled by Safari (the only one to possibly implement it).
code might be a correct alternative. It represents which button on a device is pressed, without any consideration for what character that button is supposed to generate. This might be low level enough to keep student struggles aloft, but standard enough to work consistently in many browsers.
Mozilla developer network has marked
KeyboardEvent.whichto be deprecated and nonstandard, even though most browsers have implemented it (albeit in an non-unified fashion).https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/which
Considerations:
keyCodeandcharCodeare also both deprecated, with inconsistent browser support.keyis current and standard, however it does all the work that we're doing to take into account shift, locale, etc.keyIdentifierseems to be a highly unimplemented and nonstandard stunt pulled by Safari (the only one to possibly implement it).codemight be a correct alternative. It represents which button on a device is pressed, without any consideration for what character that button is supposed to generate. This might be low level enough to keep student struggles aloft, but standard enough to work consistently in many browsers.