Fix HWCursorTest

This commit is contained in:
Elias Naur 2007-01-02 11:09:05 +00:00
parent 662e9c7e7a
commit 861421e16c
1 changed files with 11 additions and 6 deletions

View File

@ -276,6 +276,7 @@ public class HWCursorTest {
int button = Mouse.getEventButton(); int button = Mouse.getEventButton();
if(button >= 0 && button < 3 && Mouse.getEventButtonState()) { if(button >= 0 && button < 3 && Mouse.getEventButtonState()) {
mouse_btn = Mouse.getEventButton(); mouse_btn = Mouse.getEventButton();
switchCursor();
} }
} }
} }
@ -337,11 +338,7 @@ public class HWCursorTest {
} }
if (Keyboard.isKeyDown(Keyboard.KEY_N)) { if (Keyboard.isKeyDown(Keyboard.KEY_N)) {
try { switchCursor();
Mouse.setNativeCursor(cursor[mouse_btn]);
} catch (Exception e) {
e.printStackTrace();
}
} }
while(Keyboard.next()) { while(Keyboard.next()) {
@ -351,6 +348,14 @@ public class HWCursorTest {
} }
} }
private void switchCursor() {
try {
Mouse.setNativeCursor(cursor[mouse_btn]);
} catch (Exception e) {
e.printStackTrace();
}
}
/** /**
* Cleans up the test * Cleans up the test
*/ */