title: SWT KeyEvent bug or design miss the release event completely
body: <p>Copy the code below in your IDE. I tested that code with Windows 10, Java 8.</p>
  
  <p>Press 2 keys say A (first) and B (second) and release the first key pressed before quickly releasing the second key pressed. The release event for the second key pressed is lost. </p>
  
  <p>If you keep the second key pressed, it will start generating key repetition again and then the key release is caught.</p>
  
  <p>This event disappearing actually screw up the code because it cannot account for the missed release event and the state is screwed. This bug is a disgrace!! Worse than AWT Linux Key event bug which I found a decent fix for.</p>
  
  <p>Do you see a solution? Can you disable key repetition in SWT (Maybe)?</p>
  
  <pre><code>import org.eclipse.swt.SWT;
  import org.eclipse.swt.events.KeyAdapter;
  import org.eclipse.swt.events.KeyEvent;
  import org.eclipse.swt.layout.FillLayout;
  import org.eclipse.swt.widgets.Button;
  import org.eclipse.swt.widgets.Display;
  import org.eclipse.swt.widgets.Shell;
  
  public class SWTKeyEvent {
   public static void main(String[] args) {
    Display display = new Display();
    Shell shell = new Shell(display);
    shell.setText("SWT KeyEvent Example");
  
    shell.setLayout(new FillLayout());
  
    Button button = new Button(shell, SWT.CENTER);
  
    button.setText("Type Something");
  
    button.addKeyListener(new KeyAdapter() {
       public void keyPressed(KeyEvent e) {
          boolean isKeyRepeat = isKeyRepeat(e.keyCode);
          if (!isKeyRepeat) {
             System.out.println("\t keyPressed " + e.keyCode);
          } else {
             System.out.println("keyRepeated " + e.keyCode);
          }
       }
  
       public void keyReleased(KeyEvent e) {
          System.out.println("\t\t keyReleased " + e.keyCode);
          keyReleaseRepeat(e.keyCode);
       }
  
    });
  
    shell.open();
  
    while (!shell.isDisposed()) {
       if (!display.readAndDispatch())
          display.sleep();
    }
    display.dispose();
   }
  
  protected static int   pressedKeyCounter;
  
  protected static int[] pressedKeys = new int[20];
  
  
  
  public static boolean isKeyRepeat(int keyCode) {
    for (int i = 0; i &lt; pressedKeyCounter; i++) {
       if (pressedKeys[i] == keyCode) {
          return true;
       }
    }
    pressedKeys[pressedKeyCounter] = keyCode;
    pressedKeyCounter++;
    return false;
  }
  
  
  public static void keyReleaseRepeat(int keyCode) {
    boolean shift = false;
    for (int i = 0; i &lt; pressedKeyCounter; i++) {
       if (pressedKeys[i] == keyCode) {
          shift = true;
       } else if (shift) {
          pressedKeys[i - 1] = pressedKeys[i];
       }
    }
    if (pressedKeyCounter &gt; 0) {
       pressedKeyCounter--;
    }
  }
  </code></pre>
  
  <p>EDIT: In Swing or JavaFX, the release event is NEVER lost</p>