This code was originally taken from
http://www.webmonkey.com/webmonkey/05/10/stuff/active4.html , and then adapted.
The larger tutorial is available at
http://www.webmonkey.com/webmonkey/05/10/index4a_page9.html?tw=programming .
Used without permission.
This page may be most useful to you as a way to figure out which key corresponds to which keycode. In other words, if you're looking to have your program do something when the player pushes the 'j' key (for jump, maybe), then you'll need to know which number corresponds to 'j'. So bring up this web page, hit the 'j' key, and use that the keycode value in your program :)
Also, be aware that IE7 appears to NOT allow you to 'cancel' keyboard commands - Ctrl+O will always run the "Open File" dialog