mirror of
https://github.com/processing/processing4.git
synced 2026-02-12 01:50:44 +01:00
fix bug with multiple key events coming through
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user