File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -658,6 +658,7 @@ public class PApplet implements PConstants {
658658 * @see PApplet#keyReleased()
659659 */
660660 public boolean keyPressed;
661+ int keyPressedCount;
661662
662663 /**
663664 * The last KeyEvent object passed into a mouse function.
@@ -2934,11 +2935,13 @@ protected void handleKeyEvent(KeyEvent event) {
29342935
29352936 switch (event.getAction()) {
29362937 case KeyEvent.PRESS:
2938+ keyPressedCount++;
29372939 keyPressed = true;
29382940 keyPressed(keyEvent);
29392941 break;
29402942 case KeyEvent.RELEASE:
2941- keyPressed = false;
2943+ keyPressedCount--;
2944+ keyPressed = (keyPressedCount == 0);
29422945 keyReleased(keyEvent);
29432946 break;
29442947 case KeyEvent.TYPE:
Original file line number Diff line number Diff line change 110259 (3.3.2)
22X add (far) more efficient file loading for loadBytes(File)
33X add loadBytes(URL) variant that uses content length header for array size
4+ X keyPressed is false if one key is released while multiple keys are pressed
5+ X https://github.com/processing/processing/issues/4993
46
57andres
68X Assigning Pixels Vertically Flipped in P2D
You can’t perform that action at this time.
0 commit comments