However, that said, here's a method that works in IE 4 and above. I have the code setup for Netscape as well, just in case you want to use the code to trap keys in Netscape and IE (but they will only be successfully disabled in IE).
// Netscape uses e, IE window.event
var eventObj = (e)?e:window.event;
var keyPressed = (e)?e.which:window.event.keyCode;
var ctrlPressed = (e)?(e.ctrlKey):window.event.ctrlKey;
case 80: // CTRL-P.
window.event.keyCode = 0;
This code disables only CTRL-P, which can be useful in preventing printing of a page. It doesn't work at all if the user has Netscape. The key is trapped, but the Print dialog still comes up. Even if you try to set e.which to 0, it still does not work.
Okay, off the soapbox.
That's it for today. Feel free to email me with any questions or comments.