diff --git a/modules/lwjgl/lwjglx/src/main/java/org/lwjgl/input/Keyboard.java b/modules/lwjgl/lwjglx/src/main/java/org/lwjgl/input/Keyboard.java index d1ff345b96..1fa1a92af2 100644 --- a/modules/lwjgl/lwjglx/src/main/java/org/lwjgl/input/Keyboard.java +++ b/modules/lwjgl/lwjglx/src/main/java/org/lwjgl/input/Keyboard.java @@ -395,7 +395,7 @@ private static void read() { public static boolean isKeyDown(int key) { if (!created) throw new IllegalStateException("Keyboard must be created before you can query key state"); - if(key >= KEYBOARD_SIZE) return false; + if(key < 0 || key >= keyDownBuffer.limit()) return false; return keyDownBuffer.get(key) != 0; }