I would like to be able to log the key presses on a specific page, trying to implement an \'Easter egg\' type functionality where when the correct keys are pressed in the co
Using jQuery:
$(document).keyup( function(e) { if (e.keyCode == 27) { alert("You pressed escape"); } });
This captures key presses on the whole page not just a specific element.
This blog post details how to capture CTRL+Key shortcuts.