I have the following javascript code...Here I am using onKeyPress=\"someFunction( )\" in the body tag to get the keyCode of the key that is pressed.
When problems like this show up, I start to use any kind of a JavaScript framework. Those frameworks are build to avoid problems with different browsers.
To catch all different keypress() apis, like the link from Emmett shows, can be very difficult.
Example:
In HTML head:
In the JS tag:
$(document).keydown(function(event) {
alert('You pressed '+event.keyCode);
event.preventDefault();
});