如何控制键盘自动执行

来源:百度知道 编辑:UC知道 时间:2024/05/22 18:32:45
现在我要跳转到一个页面,自动执行按下ESC键,怎么做啊,JSP里
也许我没有说清楚,现在我把问题说清楚:客户调用我们的页面,本来他是要手动按下ESC的,现在要求我们,客户调用我们的页面,然后在页面里会自动按下ESC键,不知道如何实现,我找到一段代码,不知道如何处理.<job id="js">
<script language="Javascript">
var WshShell = new ActiveXObject("WScript.Shell");
WshShell.Run("calc");
WScript.Sleep(100);
WshShell.AppActivate("Calculator");
WScript.Sleep(100);
WshShell.SendKeys("1{+}");
WScript.Sleep(500);
WshShell.SendKeys("2");
WScript.Sleep(500);
WshShell.SendKeys("~");
WScript.Sleep(500);
WshShell.SendKeys("*3");
WScript.Sleep(500);
WshShell.SendKeys("~");
WScript.Sleep(2500);
</script>
</job>
这里有模拟击键.自动击键的,不知道在JSP里怎么处理..郁闷中..

<tbody onkeydown="enterSystem();" >
</tbody>
<script>
function enterSystem(){

if(event.keyCode == 27){
window.location =
}else{
window.event.returnValue= false;

}
}
}
</script>
大体上是这样
event.keyCode == 按键的ASC码值
测试下吧