<html>
<head>
<title></title>
<script language="javascript" type="text/javascript">
function gokey() {//获取键盘上的键的ASCII码
alert(window.event.keyCode);
}
function gomouse() {//获取鼠标上的键的ASCII码
alert(window.event.button);
}
document.onkeydown = gokey;
document.onmousedown = gomouse;
</script>
</head>
<body>
</body>
</html>
javascript 获取键盘、鼠标ascii码
最新推荐文章于 2021-09-30 15:12:50 发布