remove use of getButton() in PApplet, which was java 1.3 only

This commit is contained in:
benfry
2005-04-23 19:19:33 +00:00
parent a0bec1f264
commit fa8aa751db
2 changed files with 30 additions and 4 deletions

View File

@@ -1188,12 +1188,12 @@ public class PApplet extends Applet
mouseY = event.getY();
mouseEvent = event;
int button = event.getButton();
if (button == 1) {
int modifiers = event.getModifiers();
if ((modifiers & MouseEvent.BUTTON1_MASK) != 0) {
mouseButton = LEFT;
} else if (button == 2) {
} else if ((modifiers & MouseEvent.BUTTON2_MASK) != 0) {
mouseButton = CENTER;
} else if (button == 3) {
} else if ((modifiers & MouseEvent.BUTTON3_MASK) != 0) {
mouseButton = RIGHT;
}
// if running on macos, allow ctrl-click as right mouse