title: On mac, in Java, keyPressed event doesn't fire for certain keys
body: <p>This is a really weird issue, but I just have a simple keyListener added to a JPanel that prints on keyPressed and on keyReleased. Usually it works fine, but on certain keys like 'A', if I press and hold before releasing, no other keys will fire keyPressed after that release until I press and hold on certain keys like 'D'. After that, it's back to usual unless I press a "bad" key and hold it for too long. </p>
  
  <p>One last note, keyReleased ALWAYS triggers properly, it's just keyPressed which fails.</p>
  
  <p>EDIT2:
  I've simplified the code to simply the following and it still behaves as described above:</p>
  
  <pre><code>import java.awt.event.KeyEvent;
  import java.awt.event.KeyListener;
  
  import javax.swing.JFrame;
  
  public class Test {
      public static void main(String[] args) {
          JFrame frame = new JFrame();
          frame.setSize(800, 600);
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setLocationRelativeTo(null);
          frame.setVisible(true);
  
          frame.addKeyListener(new KeyListener() {
  
              @Override
              public void keyTyped(KeyEvent e) {
  
              }
  
              @Override
              public void keyPressed(KeyEvent e) {
                  System.out.println("Pressed");
              }
  
              @Override
              public void keyReleased(KeyEvent e) {
                  System.out.println("Released");
              }
  
          });
      }
  }
  </code></pre>
  
  <p>EDIT: 
  code extract: </p>
  
  <pre><code>JFrame frame = new JFrame("test");
  frame.setSize(WIDTH, HEIGHT);
  frame.setLocationRelativeTo(null);
  frame.setLayout(null);
  frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
  frame.setResizable(false);
  
  JLayeredPane panel = new JLayeredPane();
  panel.setBounds(0, 0, WIDTH, HEIGHT);
  panel.setLayout(null);
  
  
  frame.add(panel);
  KeyListener listener = new KeyListener() {
  
      public void keyTyped(KeyEvent e) {
          System.out.println("typed: "+e.getKeyCode());
      }
  
      @Override
      public void keyPressed(KeyEvent e) {
          System.out.println("pressed: "+e.getKeyCode());
      }
  
      @Override
      public void keyReleased(KeyEvent e) {
          System.out.println("released: "+e.getKeyCode());
          System.out.println();
      }
  
  };
  panel.addKeyListener(listener);
  frame.addKeyListener(listener);
  frame.setVisible(true);
  </code></pre>