title: keydown event doesn't work
body: <p>i want make player controller for my 1st game in jquery but something is wrong. Can you help me, please?</p>
  
  <pre><code>$('canvas').keydown(function(e) {
      alert('in function');
      if (e.keyCode == 37) {//37 - strzalka w lewo
          moveleft();
      }
      if (e.keyCode == 39) {//39 - strzalka w prawo
          moveright();
      }
      if (e.keyCode == 40) {//40 - strzalka w dol
          movedown();
      }
      if (e.keyCode == 38) {//38 - strzalka w gore
           moveup();
      }
      if (e.keyCode == 32) {//32 - spacja
  
      }
  });
  
  function moveup() {
      gracz.speedY -= 1; 
  }
  
  function movedown() {
      gracz.speedY += 1; 
  }
  
  function moveleft() {
      gracz.speedX -= 1;
  }
  
  function moveright() {
      gracz.speedX += 1;
  }
  </code></pre>
  
  <p>when i press arrows, event handler doesn't work</p>