track what key is pressed in javascript code example
Example: how to detect a keypress in javascript
window.addEventListener("keydown", (event) => {
console.log(event.key);
});
window.addEventListener("keydown", (event) => {
console.log(event.key);
});