What works best is to use `keydown`[1] with `keyboardEvent.key`[2]. Chrome took a while to implement `keyboardEvent.key` and I’m guessing that delay hindered adoption, but for the past few years (since the 5 year old Chrome 51) it is objectively the best—and arguably the only robust—way to figure out which key the user typed.
1: https://developer.mozilla.org/en-US/docs/Web/API/Element/key...
2: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEve...