keydown happens when key is not down code example
Example: keydown events
document.addEventListener('keydown', logKey);
function logKey(e) {
log.textContent += ` ${e.code}`;
}
document.addEventListener('keydown', logKey);
function logKey(e) {
log.textContent += ` ${e.code}`;
}