From 861421e16c1e0a005a1d0f977f0bfed02753757e Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Tue, 2 Jan 2007 11:09:05 +0000 Subject: [PATCH] Fix HWCursorTest --- src/java/org/lwjgl/test/input/HWCursorTest.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/java/org/lwjgl/test/input/HWCursorTest.java b/src/java/org/lwjgl/test/input/HWCursorTest.java index 4d43e177..a14c29a2 100644 --- a/src/java/org/lwjgl/test/input/HWCursorTest.java +++ b/src/java/org/lwjgl/test/input/HWCursorTest.java @@ -276,6 +276,7 @@ public class HWCursorTest { int button = Mouse.getEventButton(); if(button >= 0 && button < 3 && Mouse.getEventButtonState()) { mouse_btn = Mouse.getEventButton(); + switchCursor(); } } } @@ -337,11 +338,7 @@ public class HWCursorTest { } if (Keyboard.isKeyDown(Keyboard.KEY_N)) { - try { - Mouse.setNativeCursor(cursor[mouse_btn]); - } catch (Exception e) { - e.printStackTrace(); - } + switchCursor(); } while(Keyboard.next()) { @@ -350,7 +347,15 @@ public class HWCursorTest { } } } - + + private void switchCursor() { + try { + Mouse.setNativeCursor(cursor[mouse_btn]); + } catch (Exception e) { + e.printStackTrace(); + } + } + /** * Cleans up the test */