window.onkeydown = function(e) { console.log(e); e.preventDefault(); };
<audio class="sound__click"> <source src="sounds/click.ogg" type="audio/ogg"> </audio>
var audio = document.querySelector('.sound__click'); audio.play();