Use this!

event.isTrusted
Press a key
event.code
Press a key
event.key
Press a key

Not this! (deprecated)

event.keyCode
Press a key
event.which
Press a key