<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript">
var lastkeyCode = -1;
function TestKeyDown(event) {
if (event.keyCode == lastkeyCode) {
alert("重复按下了某个按键!");
//处理
}
lastkeyCode = event.keyCode;
}
</script>
</head>
<body>
<input type="text" value="Test" οnkeydοwn="TestKeyDown(event);" />
</body>
</html>
判断是否长按某一键
最新推荐文章于 2020-05-19 08:37:19 发布