📅  最后修改于: 2022-03-11 15:01:42.830000             🧑  作者: Mango
document.addEventListener("keydown", function(event) {
console.log(`Key pressed: ${event.key}`);
// event.key is a string representing which key has been pressed
});