This is in the same line of thinking as the Hook F5 mention.
Sometimes it is usefull to "trap" a key - especially enter - and to do something other then the normal form submit or what ever.
function trapEnter(e)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true
if (keycode == 13)
{
//If enter should do nothing
/*
e.returnValue = false;
e.cancel = true;
return false;
*/
//Otherwise - do stuff
}
return true;
}