Capturing Key Codes with JavaScript

Ever wonder how ThinkFree of Gmail are able to save your content when you hit 'Ctrl + s'? They are capturing the key combination, and using to it fire a client-side function. Here's a function you can adapt to use whichever keycode or combination to suit your purposes.

Note: in IE, when pressing the ctrl + shift + key, it gives the key code for the capitalized key (probably because shift is pressed). In Netscape. pressing ctrl, shift and another key doesn't change the keycode. If you need to determine what the keycode is for your combination, just un-comment the 'debug' line.