If you had like me troubles getting your js keys input to work on itch.io, this solved the issue for me: Assume you have some sort of canvas, and a script section in the html file, add an onclick handler to the canvas and a function to the script section, like this:
<body>
<div align="center">
<canvas id="3darea" width="800" height="600" style='background-color:#"#000000"' onclick='refocus_myself()'>
</canvas>
</div>
<script type="text/javascript">
<!--
//....
function refocus_myself(){
var mycanvas= mycanvas=document.getElementById('3darea');
mycanvas.setAttribute('tabindex','0');
mycanvas.focus();
}
-->
</script>
<br/>
</body>
it's that one tabindex thingie that does the trick.