当前位置:网站首页>js 键值判断
js 键值判断
2022-04-23 14:09:00 【瑞瑞小同学】
$("body").on("keydown",function(event){
debugLog("event.which:"+event.which);
if(event.which === 37){
debugLog("left37")
event.preventDefault();
}else if(event.which == 38){
debugLog("up38")
event.preventDefault();
}else if(event.which == 39){
debugLog("right39")
event.preventDefault();
}else if(event.which == 40){
debugLog("down40")
event.preventDefault();
}else if(event.which == 13){
debugLog("enter13")
event.preventDefault();
}else if(event.which == 27){
debugLog("返回27")
event.preventDefault();
}
});
版权声明
本文为[瑞瑞小同学]所创,转载请带上原文链接,感谢
https://blog.csdn.net/yr123456654321/article/details/113118455
边栏推荐
猜你喜欢
Wechat applet positioning and ranging through low-power Bluetooth device (2)
Installation and use of postman pit
How QT designer adds resource files
多云数据流转?云上容灾?年前最后的价值内容分享
处理 mkdir:无法创建目录“aaa“:只读文件系统
Logback logger and root
微信小程序客服接入,实现发送和接收消息
VMware Workstation 无法连接到虚拟机。系统找不到指定的文件
VMWare安装64位XP中文教程
Research on recyclerview details - Discussion and repair of recyclerview click dislocation
随机推荐
剑指offer刷题(1)--面向华为
redis数据库讲解(四)主从复制、哨兵、Cluster群集
Jmeter设置环境变量支持在任意终端目录输入jmeter直接启动
百度笔试2022.4.12+编程题目:简单整数问题
星界边境文本自动翻译机(高级版)使用说明
线程间控制之CountDownLatch和CyclicBarrier使用介绍
json date时间日期格式化
mysql 5.1升级到5.69
yml引用其他变量
ActiveMq基础知识
JDBC details
On September 8, the night before going to Songshan Lake
困扰多年的系统调研问题有自动化采集工具了,还是开源免费的
差分隐私(背景介绍)
jsp学习3
容灾有疑问?点这里
How to do a project easily
Wechat applet communicates with low-power Bluetooth - receives data sent by hardware (IV)
pthread_ Why does self() repeat
字节面试编程题:最小的K个数