From 9f41ecaedbb378de5cabd21a9e88b81beca8ef41 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Sat, 10 Jun 2006 20:42:26 +0000 Subject: [PATCH] Removed Keyboard.isStateKeySet() - it is easily replaced by Toolkit.getLockingKeyState() --- src/java/org/lwjgl/input/Keyboard.java | 9 ++++----- src/java/org/lwjgl/opengl/DisplayImplementation.java | 2 +- src/java/org/lwjgl/opengl/LinuxDisplay.java | 4 ++-- src/java/org/lwjgl/opengl/MacOSXDisplay.java | 4 ++-- src/java/org/lwjgl/opengl/Win32Display.java | 2 +- src/native/win32/org_lwjgl_input_Keyboard.c | 4 ++-- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/java/org/lwjgl/input/Keyboard.java b/src/java/org/lwjgl/input/Keyboard.java index cc17ca3e..55c18ea7 100644 --- a/src/java/org/lwjgl/input/Keyboard.java +++ b/src/java/org/lwjgl/input/Keyboard.java @@ -191,10 +191,10 @@ public class Keyboard { public static final int KEY_POWER = 0xDE; public static final int KEY_SLEEP = 0xDF; - public static final int STATE_ON = 0; +/* public static final int STATE_ON = 0; public static final int STATE_OFF = 1; public static final int STATE_UNKNOWN = 2; - +*/ public static final int KEYBOARD_SIZE = 256; /** Buffer size in events */ @@ -334,7 +334,6 @@ public class Keyboard { * character for that event. * * @see org.lwjgl.input.Keyboard#isKeyDown(int key) - * @see org.lwjgl.input.Keyboard#isStateKeySet(int key) * @see org.lwjgl.input.Keyboard#next() * @see org.lwjgl.input.Keyboard#getEventKey() * @see org.lwjgl.input.Keyboard#getEventKeyState() @@ -371,12 +370,12 @@ public class Keyboard { * @param key State key to test (KEY_CAPITAL | KEY_NUMLOCK | KEY_SYSRQ) * @return STATE_ON if on, STATE_OFF if off and STATE_UNKNOWN if the state is unknown */ - public static int isStateKeySet(int key) { +/* public static int isStateKeySet(int key) { if (!created) throw new IllegalStateException("Keyboard must be created before you can query key state"); return Display.getImplementation().isStateKeySet(key); } - +*/ /** * Gets a key's name * @param key The key diff --git a/src/java/org/lwjgl/opengl/DisplayImplementation.java b/src/java/org/lwjgl/opengl/DisplayImplementation.java index 7450c7f7..a9633ec1 100644 --- a/src/java/org/lwjgl/opengl/DisplayImplementation.java +++ b/src/java/org/lwjgl/opengl/DisplayImplementation.java @@ -203,7 +203,7 @@ public interface DisplayImplementation { */ int readKeyboard(IntBuffer buffer, int buffer_position); - int isStateKeySet(int key); +// int isStateKeySet(int key); /** Native cursor handles */ Object createCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException; diff --git a/src/java/org/lwjgl/opengl/LinuxDisplay.java b/src/java/org/lwjgl/opengl/LinuxDisplay.java index 2e1324a9..213e3eae 100644 --- a/src/java/org/lwjgl/opengl/LinuxDisplay.java +++ b/src/java/org/lwjgl/opengl/LinuxDisplay.java @@ -625,10 +625,10 @@ final class LinuxDisplay implements DisplayImplementation { } private static native int nReadKeyboard(IntBuffer buffer, int buffer_position); - public int isStateKeySet(int key) { +/* public int isStateKeySet(int key) { return Keyboard.STATE_UNKNOWN; } - +*/ private static native ByteBuffer nCreateCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, int images_offset, IntBuffer delays, int delays_offset) throws LWJGLException; public Object createCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException { diff --git a/src/java/org/lwjgl/opengl/MacOSXDisplay.java b/src/java/org/lwjgl/opengl/MacOSXDisplay.java index 7fa75df3..69790f0b 100644 --- a/src/java/org/lwjgl/opengl/MacOSXDisplay.java +++ b/src/java/org/lwjgl/opengl/MacOSXDisplay.java @@ -413,7 +413,7 @@ final class MacOSXDisplay implements DisplayImplementation { return keyboard_queue.copyEvents(buffer); } - public int isStateKeySet(int key) { +/* public int isStateKeySet(int key) { int awt_key; switch (key) { case Keyboard.KEY_CAPITAL: @@ -436,7 +436,7 @@ final class MacOSXDisplay implements DisplayImplementation { return Keyboard.STATE_UNKNOWN; } } - +*/ /** Native cursor handles */ public Object createCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException { BufferedImage cursor_image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); diff --git a/src/java/org/lwjgl/opengl/Win32Display.java b/src/java/org/lwjgl/opengl/Win32Display.java index bd874650..b97498b0 100644 --- a/src/java/org/lwjgl/opengl/Win32Display.java +++ b/src/java/org/lwjgl/opengl/Win32Display.java @@ -164,7 +164,7 @@ final class Win32Display implements DisplayImplementation { } private native int nReadKeyboard(IntBuffer buffer, int buffer_position); - public native int isStateKeySet(int key); +// public native int isStateKeySet(int key); public native ByteBuffer nCreateCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, int images_offset, IntBuffer delays, int delays_offset) throws LWJGLException; diff --git a/src/native/win32/org_lwjgl_input_Keyboard.c b/src/native/win32/org_lwjgl_input_Keyboard.c index eec17568..aff214e5 100644 --- a/src/native/win32/org_lwjgl_input_Keyboard.c +++ b/src/native/win32/org_lwjgl_input_Keyboard.c @@ -277,7 +277,7 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Win32Display_nReadKeyboard return num_events; } -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Win32Display_isStateKeySet(JNIEnv *env, jobject self, jint key) +/*JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Win32Display_isStateKeySet(JNIEnv *env, jobject self, jint key) { int state = org_lwjgl_input_Keyboard_STATE_UNKNOWN; switch(key) { @@ -293,4 +293,4 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Win32Display_isStateKeySet(JNIEnv * } return state; -} +}*/