我是靠谱客的博主 忧郁酸奶,这篇文章主要介绍接收键盘指令的脚本,现在分享给大家,希望可以做个参考。

按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>

最后

以上就是忧郁酸奶最近收集整理的关于接收键盘指令的脚本的全部内容,更多相关接收键盘指令内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(225)

评论列表共有 0 条评论

立即
投稿
返回
顶部