title: How to Override Key Repeat - KeyListener
body: <p>I have a Graphics project that contains KeyListener, where the arrow keys and space bar controls the movement of a spaceship. However, when a key is held down, it registers the next key presses after a delay after the first. I would like for a held down key to register continuously.</p>
  
  <p>I suspect that this is due to my computer's setting for key repeat delay, so is there any way to temporarily override this in my program, or a workaround for it?</p>
  
  <pre><code>public void keyPressed(KeyEvent e) {
      if (e.getKeyCode() == 38) { //Up Arrow
          currentLevel.moveSpiffUp();
      } else if (e.getKeyCode() == 40) { //Down Arrow
          currentLevel.moveSpiffDown();
      } else if (e.getKeyCode() == 32 &amp;&amp; !currentLevel.getFrapRayActive()) { 
          currentLevel.shoot();
      }
      repaint();
  }
  </code></pre>