From 65309d759cb8afe2d4b5bf49bbc0dc8f25264695 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Sun, 2 Mar 2008 18:16:39 +0000 Subject: [PATCH] Added notes to Mouse.poll() and Keyboard.poll() that Display.processMessages() (or Display.update()) must be called to receive new input state --- src/java/org/lwjgl/input/Keyboard.java | 3 +++ src/java/org/lwjgl/input/Mouse.java | 3 +++ src/java/org/lwjgl/opengl/Display.java | 6 +++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/java/org/lwjgl/input/Keyboard.java b/src/java/org/lwjgl/input/Keyboard.java index 47ff57dc..4b28fd2a 100644 --- a/src/java/org/lwjgl/input/Keyboard.java +++ b/src/java/org/lwjgl/input/Keyboard.java @@ -363,6 +363,9 @@ public class Keyboard { * getEventKeyState - finally use getEventCharacter to get the * character for that event. * + * NOTE: This method does not query the operating system for new events. To do that, + * Display.processMessages() (or Display.update()) must be called first. + * * @see org.lwjgl.input.Keyboard#isKeyDown(int key) * @see org.lwjgl.input.Keyboard#next() * @see org.lwjgl.input.Keyboard#getEventKey() diff --git a/src/java/org/lwjgl/input/Mouse.java b/src/java/org/lwjgl/input/Mouse.java index 8fca9bbb..9ef3622d 100644 --- a/src/java/org/lwjgl/input/Mouse.java +++ b/src/java/org/lwjgl/input/Mouse.java @@ -303,6 +303,9 @@ public class Mouse { * getEventButton. To get the state of that button, for that event, use * getEventButtonState. * + * NOTE: This method does not query the operating system for new events. To do that, + * Display.processMessages() (or Display.update()) must be called first. + * * @see org.lwjgl.input.Mouse#next() * @see org.lwjgl.input.Mouse#getEventButton() * @see org.lwjgl.input.Mouse#getEventButtonState() diff --git a/src/java/org/lwjgl/opengl/Display.java b/src/java/org/lwjgl/opengl/Display.java index fd9014eb..6b92eeb1 100644 --- a/src/java/org/lwjgl/opengl/Display.java +++ b/src/java/org/lwjgl/opengl/Display.java @@ -576,9 +576,9 @@ public final class Display { } /** - * Process operating system events. Call this to update the Display's state and make sure the - * input devices receive events. This method is called from update(), and should normally not be called by - * the application. + * Process operating system events. Call this to update the Display's state and to receive new + * input device events. This method is called from update(), so it is not necessary to call + * this method if update() is called periodically. */ public static void processMessages() { synchronized (GlobalLock.lock) {