在页面怎么用JS捕获机顶盒的遥控器按了什么键???在页面怎么用JS捕获机顶盒的遥控器按了什么键???document.onkeypress = grabEvent;
document.onsystemevent = grabEvent;
document.onkeypress = grabEvent;
document.onirkeypress = grabEvent;
function grabEvent() {
var key_code = event.which;
switch (key_code) {
case 1: //up
case 269:
menuFocus(-1);
return 0;
break;
case 2: //down
case 270:
menuFocus(1);
return 0;
break;
case 3: //left
case 271:
menuFocus(-5);
return 0;
break;
case 4: //right
case 272:
menuFocus(5);
return 0;
break;
case 13:
return 0;
break;
case 340: //back
case 283:
return 0;
break;
case 372:进来学习了