← Back to Home
Press any key to get the code
0
event.key
-
event.location
-
event.code
-
How it works: The script attaches an addEventListener('keydown') to the global window object. Whenever any key is pressed, it prevents default browser actions (like scrolling with spacebar) and extracts properties like e.keyCode, e.key, and e.code to display them instantly on screen.