手动查看键盘按键事件
一、查看所有键
document.onkeydown = function (event) {
console.log('按下:' + event.key + '键:' + event.keyCode)
}
document.onkeydown = function (event) { if (event.ctrlKey && event.keyCode == 96) { console.log('按下了CTRL+0') } }
// 组合键
altKey:按下Alt+*组合键时为true
ctrlKey:按下Ctrl+*组合键时为true
shiftKey:按下Shift+*组合键时为true