fix bug with multiple key events coming through

This commit is contained in:
benfry
2005-04-07 00:54:21 +00:00
parent 976ec7bac1
commit 9121904ff7
5 changed files with 45 additions and 10 deletions

View File

@@ -1097,6 +1097,22 @@ public class PApplet extends Applet
//////////////////////////////////////////////////////////////
protected boolean listenersAdded;
public void addListeners() {
if (!listenersAdded) {
addMouseListener(this);
addMouseMotionListener(this);
addKeyListener(this);
addFocusListener(this);
listenersAdded = true;
}
}
//////////////////////////////////////////////////////////////
MouseEvent mouseEventQueue[] = new MouseEvent[10];
int mouseEventCount;