title: prevent simultanoeous keyup events?
body: <p>I have a cross word puzzle app I'm working on where each square has an input field and keyup event attached to it. It programmed to take in the pressed charachter and automatically move to the next square in the line. However, if I press two keys at near the same time the square will fill with 2 letters before jumping to the next square. I tried changing the squares maxlength to 1 but it causes the program to skip the next square after inserting the first letter.</p>
  
  <p>Is there a way to check if a key is currently pressed when pressing a different key? I could do a small timeout until the first press finishes.</p>
  
  <p>any ideas?</p>
  
  <pre><code> function keyUp( event )
      {
      if ( event.currentTarget.tagName != "HTML" ) return;
  
      if(event.which == 8){
          event.preventDefault();
  
  }
  
  if(event.which == 13){
      var dir = getDirection(_cwo.currRow, _cwo.currCol);
      if(dir == "across")goAcross(true);
      else
      goDown(true);
  
  }
  if ( event.which == 37 ) goAcross( true );
  if ( event.which == 38 ) goDown( true );
  if ( event.which == 39 ) goAcross( false );
  if ( event.which == 40 ) goDown( false);
  if (
  ( 32 == event.which ) ||
  ( ( 64 &lt; event.which ) &amp;&amp; ( event.which &lt; 91 ) ) ||
  ( ( 96 &lt; event.which ) &amp;&amp; ( event.which &lt; 123 ) )
  )
  {
  
  
  _char = codeToChar( event.which );
  if ( _char == _cwo.NA ) return;
  $( _cwo.currCell).data( 'player', _char );
  paintCell( _cwo.currCell, 'player');
  
  
  
  $("#" + cellID( _cwo.currRow, _cwo.currCol )).click();
  alignClue( "A", _cwo.clues["across"] );
  alignClue( "D", _cwo.clues["down"] );
  
  
  };
  </code></pre>