功能键F1-F2:112-123
a-b:65-90
数字键:0-9:48-57
ESC:27
退格键:8
回车:13
shift:16;Ctrl:17;Alt:18
空格:32
Insert:45;Delete:46
document.onkeydown=MM_KeyPress;
function MM_KeyPress(num){
//防止系统退格键
var keycode = event.keyCode;
if(keycode ==8)//屏蔽退格健
{
event.keyCode = 0;
//event.returnValue=false;
return;
}
if(keycode >=112 && keycode <=123)//屏蔽f1-12功能键
{
event.keyCode = 0 ;
event.returnValue=false;
return;
}
}