From 13d345abcebe3a9188ae6eaa430d26f49a4788e0 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Mon, 26 Jun 2006 14:13:57 +0000 Subject: [PATCH] Widened Keyboard.getEventCharacter() return type from char to int to accomodate 32 bit characters. --- src/java/org/lwjgl/input/Keyboard.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/java/org/lwjgl/input/Keyboard.java b/src/java/org/lwjgl/input/Keyboard.java index 96f7b61e..c5de839a 100644 --- a/src/java/org/lwjgl/input/Keyboard.java +++ b/src/java/org/lwjgl/input/Keyboard.java @@ -59,7 +59,7 @@ public class Keyboard { * The special character meaning that no * character was translated for the event. */ - public static final char CHAR_NONE = '\0'; + public static final int CHAR_NONE = '\0'; /** * The special keycode meaning that only the @@ -243,12 +243,12 @@ public class Keyboard { /** * The key events from the last read: a sequence of pairs of key number, * followed by state. The state is followed by - * a 2 byte java char representing the translated character. + * a 4 byte java int representing the translated character. */ private static IntBuffer readBuffer; /** The current keyboard character being examined */ - private static char eventCharacter; + private static int eventCharacter; /** The current keyboard event key being examined */ private static int eventKey; @@ -425,8 +425,7 @@ public class Keyboard { if (readBuffer.hasRemaining()) { eventKey = readBuffer.get() & 0xFF; eventState = readBuffer.get() != 0; - int eventCharacterInt = readBuffer.get() & 0xFFFF; - eventCharacter = (char)eventCharacterInt; + eventCharacter = readBuffer.get(); return true; } else { return false; @@ -443,7 +442,7 @@ public class Keyboard { /** * @return The character from the current event */ - public static char getEventCharacter() { + public static int getEventCharacter() { return eventCharacter; }