I want to use hotkeys in one of my pages. However, it seems that the only key that can be detected in my hotkeys is the Enter Key.
$(document).keypress(function(e) {
var key = e.which;
switch (key)
{
case 72:
alert("H");
break;
case 82:
alert("R");
break;
case 66:
alert("B");
break;
case 13:
alert("ENTER");
break;
default:
alert("Invalid");
}
});
Reference of key code values: http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes