接收键盘指令的脚本

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

接收键盘指令的脚本

  2020-05-11 我要评论

按A就会跳转到地图名片的网页,请按A
<SCRIPT language="JavaScript">
<!--
var hotkey=97
var destination="http://mc.mapabc.com"
if (document.layers)
document.captureEvents(Event.KEYPRESS)
function backhome(e){
if (document.layers){
if (e.which==hotkey)
window.location=destination
}
else if (document.all){
if (event.keyCode==hotkey)
window.location=destination
}
}
document.onkeypress=backhome

 

onkeydown="javascript:onenter();"

function onenter(){
 if(event.keyCode==13){
alert("回车");
}
}
</SCRIPT>

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们