This issue is reproducible in many API's and many programs. It is not an issue with the hardware, but appears to be an issue with ambiguity in W3C DOM keyboard event handling standard. The only legal types that the standard allows for are left, right, number pad and standard. This leaves ambiguity in how API's are expected to handle the same key code with multiple simultaneous key positions.
On a 2012 Macbook Pro running Yosemite 10, I am also seeing the left/right shift stuck-key behavior. This issue also exists for left/right alt and ctrl keys. The issue is easily reproduced by holding the left key, then the right, then releasing the left and finally the right for any of types mentioned.
AWT correctly alerts that one of the two (either left or right) is released via the event handler leaving the other in what might be interpreted as a stuck state by applications that try to distinguish left and right keys, but LWJGL does not report that either has been released for some reason. This is why the key is sometimes still reported as "pressed." I also saw this issue in Windows 7.
The mentioned issue is why many games refuse to distinguish left and right action-keys even though the hardware is capable of distinguishing them. The only Java API I have seen that is capable of directly accessing the left/right action key states so far is jnativehook, but it shows the simultaneous selection of left and right action keys as a modifier change only and not as an event.
If this issue can be fixed in LWJGL, I would choose it over AWT. I can also do some digging in the code to see if I find anything.
Sample code:
import org.lwjgl.LWJGLException;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;
public class InputSampler {
public void start() {
try {
Display.setDisplayMode(new DisplayMode(800, 600));
Display.create();
} catch (LWJGLException e) {
e.printStackTrace();
System.exit(0);
}
while (!Display.isCloseRequested()) {
pollInput();
Display.update();
}
Display.destroy();
}
public void pollInput() {
while( Keyboard.next() ) {
if( Keyboard.getEventKeyState() ) {
System.out.print(Keyboard.getKeyName(Keyboard.getEventKey()));
System.out.println(" pressed");
} else {
System.out.print(Keyboard.getKeyName(Keyboard.getEventKey()));
System.out.println(" released");
}
}
}
public static void main(String[] argv) {
InputSampler inputExample = new InputSampler();
inputExample.start();
}
}