UIEvents - Keyboard Query APIs
Identify the physical key being pressed; Query key from layout.
Please Support New KeyboardEvents commented
Microsoft, PLEASE add support KeyboardEvent.code in your browser. And please standardize your support of KeyboardEvent.key to match other browsers.
As of the date this comment is written, Edge only has partial (non-standard) support KeyboardEvent.key, and no support for KeyboardEvent.code.
Anthony W. commented
This is supported in Firefox, Chrome, Safari and Opera: