If you press one of the shift keys (left or right, doesn't matter), hold it down, then press the other shift key so that both are down at the same time, and then release them in any order, Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) will continue to return true. A "key up" event will also not be generated for the right shift key.
It can be "unstuck" by pressing and releasing the right shift key again.
This is on Windows 7 with LWJGL version 2.8.4.
Minimal test case:
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;
import org.lwjgl.opengl.PixelFormat;
public class ShiftTest {
public static final int SCREEN_WIDTH = 640;
public static final int SCREEN_HEIGHT = 480;
public static void main(String[] args) throws Exception {
setDisplayMode();
Display.setTitle("Shift Test");
Display.setFullscreen(false);
Display.setVSyncEnabled(true);
Display.create(new PixelFormat(32, 0, 24, 8, 0));
Mouse.setGrabbed(false);
while (true) {
boolean lShiftDown = Keyboard.isKeyDown(Keyboard.KEY_LSHIFT);
boolean rShiftDown = Keyboard.isKeyDown(Keyboard.KEY_RSHIFT);
System.out.println(String.format("LShift: %b\tRShift: %b", lShiftDown, rShiftDown));
if (Display.isCloseRequested() || Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) {
break;
}
Display.update();
}
}
private static void setDisplayMode() throws Exception
{
DisplayMode[] dm = org.lwjgl.util.Display.getAvailableDisplayModes(SCREEN_WIDTH, SCREEN_HEIGHT, -1, -1, -1, -1, 60, 60);
org.lwjgl.util.Display.setDisplayMode(dm, new String[] {
"width=" + SCREEN_WIDTH,
"height=" + SCREEN_HEIGHT,
"freq=" + 60,
"bpp=" + org.lwjgl.opengl.Display.getDisplayMode().getBitsPerPixel()
});
}
}