title: Java Swing: Key pressed key stroke on an `InputMap` triggers its action several times while holding down the key
body: <p>I register </p>
  
  <pre><code>getInputMap().put(KeyStroke.getKeyStroke("pressed RIGHT"), "go right");
  </code></pre>
  
  <p>When testing the code I get: While I hold the right arrow key down, the action is triggered repeatedly and not only once as I would have expected this. </p>
  
  <p>Interestingly  </p>
  
  <pre><code>getInputMap().put(KeyStroke.getKeyStroke("released RIGHT"), "stop");
  </code></pre>
  
  <p>triggers stop only when the key is finally released.</p>
  
  <p>Is there a way to register a key stroke on an input map, so that the associated action is only triggered once at the moment when the key is pressed?</p>