前言
本次是主要是Alt键触发事件
代码如下 吾不废话
代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
document.onabort = f;//alt下
document.onkeyup = f;//alt松开
document.onkeypress = f;//alt按住
function f(e) {
console.log('${e.tybe} : unicode值${e.keycode}');
}
</script>
</body>
</html>
ps
这只是一个简单Alt触发事件的过程