Fix Mouse tests
This commit is contained in:
parent
8da3656540
commit
db332762f5
|
@ -279,7 +279,8 @@ public class HWCursorTest {
|
||||||
mouse_y = Mouse.getY();
|
mouse_y = Mouse.getY();
|
||||||
|
|
||||||
while(Mouse.next()) {
|
while(Mouse.next()) {
|
||||||
if(Mouse.getEventButtonState() && Mouse.getEventButton() < 3) {
|
int button = Mouse.getEventButton();
|
||||||
|
if(button >= 0 && button < 3 && Mouse.getEventButtonState()) {
|
||||||
mouse_btn = Mouse.getEventButton();
|
mouse_btn = Mouse.getEventButton();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -240,7 +240,7 @@ public class MouseTest {
|
||||||
private void readBufferedMouse() {
|
private void readBufferedMouse() {
|
||||||
// iterate all events, use the last button down
|
// iterate all events, use the last button down
|
||||||
while(Mouse.next()) {
|
while(Mouse.next()) {
|
||||||
if(Mouse.getEventButtonState()) {
|
if(Mouse.getEventButton() != -1 && Mouse.getEventButtonState()) {
|
||||||
lastButton = Mouse.getEventButton();
|
lastButton = Mouse.getEventButton();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue