How to detect keycode / key pressed in jquery

How to detect keycode / key pressed in jquery

Tracking a keyCode can be very helpful if you would like to give your visitors a user friendly experience. For instance, if there is an overlay open on a page, I usually press the ESC (Escape) button to close the overlay and most of the sites nowadays respond to it...