Requirement for me I have to show a particular div in full screen mode when I press a button and hide that div when the page comes back to normal mode.
I am able to
$(document).keyup(function(e) { if (e.keyCode == 27) { } // esc });
U may find this useful: How to detect escape key press with JavaScript?