title: document.onmousemove delay
body: <p>I'm trying to build an expensive script with mouse and keyboard control on canvas.
  I'm using document.onmousemove and document.onkeydown/onkeyup to do this control, but when i press any button, i've got a lot of "onkeydown" executions, and mouse lags terribly. It looks like "write-only mouse position buffer" or something. When i release the key, mouse "simulate" my earlier moves.
  I tested it on Firefox and chrome, this problem exist only on FF.</p>
  
  <p>here is some code</p>
  
  <pre><code>    document.onmousemove  = function(e){
          obj = canvas;
          var curleft = curtop = 0;
  
          do {
              curleft += obj.offsetLeft;
              curtop += obj.offsetTop;
          } while (obj = obj.offsetParent);
  
          mX = e.pageX - curleft;
          mY = e.pageY - curtop;
      }
  
      var dt=0.02;
      setInterval(tick, dt*1000);
      update(dt);
      function tick() {
  
          if((!pause) || step)
          {
              update(dt);
              step = false;
          }
          interact();
          draw();
      }
  </code></pre>