📜  检测字母 ketcode - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:33.578000             🧑  作者: Mango

代码示例1
document.addEventListener("keydown", (event) => {
    if (event.code === "Space") {
        // Spacebar was pressed, do something
    }
});
// Other keyCodes ->
// https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode