/**
* 键盘监听
*/
const keyDown = () => {
document.onkeydown = (e) => {
let lock=0;
let e1 = e || window.event || arguments.callee.caller.arguments[0]
switch (e.code) {
case "KeyW":
value.value[options_model.value].y++
break;
case "KeyA":
value.value[options_model.value].x--
break;
case "KeyS":
value.value[options_model.value].y--
break;
case "KeyD":
value.value[options_model.value].x++
break;
default:
lock=1
break;
}
}
}
onMounted(() => {
keyDown()
})
Comments | NOTHING