diff --git a/src/java/org/lwjgl/input/Keyboard.java b/src/java/org/lwjgl/input/Keyboard.java index ce0f229b..0c67e6c9 100644 --- a/src/java/org/lwjgl/input/Keyboard.java +++ b/src/java/org/lwjgl/input/Keyboard.java @@ -252,9 +252,8 @@ public class Keyboard { /** The current state of the key being examined in the event queue */ public static boolean state; - static { - initialize(); - } + /** One time initialization */ + private static boolean initialized; /** * Keyboard cannot be constructed. @@ -268,6 +267,7 @@ public class Keyboard { private static void initialize() { System.loadLibrary(Sys.getLibraryName()); initIDs(); + initialized = true; } /** @@ -282,6 +282,8 @@ public class Keyboard { * @throws Exception if the keyboard could not be created for any reason */ public static void create() throws Exception { + if (!initialized) + initialize(); if (created) return; if (!nCreate())