Skip to content

Instantly share code, notes, and snippets.

@unixpickle
Created May 28, 2017 00:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save unixpickle/b7193adbaadc5c5c861ea6a1c618a5c0 to your computer and use it in GitHub Desktop.
Save unixpickle/b7193adbaadc5c5c861ea6a1c618a5c0 to your computer and use it in GitHub Desktop.
Log key events
window.addEventListener('keydown', (e) => console.log('"' + e.code + '": &KeyEvent{Code: "' + e.code + '", Text: "' + e.key + '", KeyIdentifier: "' + e.keyIdentifier + '", Key: "' + e.key + '", WindowsVirtualKeyCode: ' + e.keyCode + ', NativeVirtualKeyCode: ' + e.keyCode + '},'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment