Segue o código com a solução do desafio proposto na aula:
const teclas = document.querySelectorAll('input[type=button]');
for (let i = 0; i < teclas.length; i++) {
teclas[i].onkeydown = function (key) {
if (key.code === "Enter" || key.code === "Space") {
teclas[i].classList.add("ativa");
}
};
teclas[i].onkeyup = function () {
teclas[i].classList.remove('ativa');
};
}