Fix bug preventing first mouse PRESS from setting mouseX/mouseY when sketch window gains focus from the PRESS.

This commit is contained in:
Jonathan Feinberg
2014-05-13 08:36:23 -04:00
parent b8d4b62158
commit a659339129
2 changed files with 41 additions and 8 deletions

View File

@@ -117,4 +117,33 @@ public class MouseEvent extends Event {
// public void setClickCount(int clickCount) {
// this.clickCount = clickCount;
// }
private String actionString() {
switch (action) {
default:
return "UNKNOWN";
case CLICK:
return "CLICK";
case DRAG:
return "DRAG";
case ENTER:
return "ENTER";
case EXIT:
return "EXIT";
case MOVE:
return "MOVE";
case PRESS:
return "PRESS";
case RELEASE:
return "RELEASE";
case WHEEL:
return "WHEEL";
}
}
@Override
public String toString() {
return String.format("<MouseEvent %s@%d,%d count:%d button:%d>",
actionString(), x, y, count, button);
}
}