capture keydown event on canvas
<pre><code>&lt;canvas id="canvas" width="1280" height="720" style="border:1px solid #c3c3c3;"&gt;&lt;/canvas&gt;

&lt;script&gt;
var canvas = document.getElementById("canvas");
canvas.addEventListener("keydown", onKeyDown);
canvas.addEventListener('mousemove', onMouseMove);


function onKeyDown(e){
    console.log(e.keyCode);
};
function onMouseMove(e){
    console.log("(X:" + e.clientX + ", Y:" + e.clientY + ")")
};
&lt;/script&gt;
</code></pre>

<p>I would like to capture the keydown event and log the keyCode of the pressed key to the console. Mousemove works but keydown wont. I've searched around on Google and as far as I can tell my code is correct.</p>
