title: Problems detecting SHIFT keys in Java on Windows
body: <p>I'm writing a simulation of an old machine in Java and I'd like my keyboard handling to treat the left- and right-<kbd>SHIFT</kbd> keys independently.  </p>
  
  <p>I have a standard AWT <code>KeyListener</code> registered and process the <code>KeyPressed()</code> and <code>KeyReleased()</code> methods.  Here's the problem:</p>
  
  <pre><code>1) Press Left-SHIFT  
    -&gt; get KeyPressed() for VK_SHIFT with location=LEFT  ... good!
  2) Keep Left-SHIFT held down, press Right-SHIFT too
    -&gt; get KeyPressed() for VK_SHIFT with location=RIGHT ... good!
  3) Release Right-SHIFT (left-SHIFT still held down)
    -&gt; get ... absolutely nothing ... bad!
  4) Release Left-SHIFT
    -&gt; get KeyReleased() for VK_SHIFT with location=LEFT ... good.
  </code></pre>
  
  <p>So, I have lost the <code>KeyReleased()</code>information for right-<kbd>SHIFT</kbd>.  This fails in this way when running on Windows, but works correctly (I see all events) on Linux.  Any ideas?  Is this just a Windows anomaly I have to live with.  Curiously it doesn't fail like this with the two <kbd>Ctrl</kbd> keys&mdash;I see all events as I'd hope.</p>
  
  <p>It is easy to reproduce this behaviour using the standard Sun <code>KeyEventDemo.java</code> program. </p>