fix a dumb typo in keyPressed handling (fixes #5033)

This commit is contained in:
Ben Fry
2017-04-26 23:01:36 -04:00
parent f41360c0bf
commit 914fb8817c
3 changed files with 6 additions and 3 deletions

View File

@@ -658,7 +658,7 @@ public class PApplet implements PConstants {
* @see PApplet#keyReleased()
*/
public boolean keyPressed;
int keyPressedCount;
public int keyPressedCount;
/**
* The last KeyEvent object passed into a mouse function.
@@ -2941,7 +2941,7 @@ public class PApplet implements PConstants {
break;
case KeyEvent.RELEASE:
keyPressedCount--;
keyPressed = (keyPressedCount == 0);
keyPressed = (keyPressedCount > 0);
keyReleased(keyEvent);
break;
case KeyEvent.TYPE: