keydown
event listener to the entire page
document.addEventListener(`keydown`, keyPressed)
keyCode
property on the event object
function keyPressed(event) { console.log(event.keyCode) }
function keyPressed(event) { if (event.keyCode == 65) { console.log(`the A key was pressed`) } }