We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e6d159 commit e6ac72bCopy full SHA for e6ac72b
core/src/processing/core/PApplet.java
@@ -2635,8 +2635,17 @@ protected void handleKeyEvent(KeyEvent event) {
2635
keyPressed = true;
2636
keyPressed(keyEvent);
2637
}
2638
- case KeyEvent.RELEASE -> {
2639
- pressedKeys.remove(((long) keyCode << Character.SIZE) | key);
+ case KeyEvent.RELEASE -> {
+ List<Long> hashesToRemove = new ArrayList<>();
2640
+ for (Long hash : pressedKeys) {
2641
+ int storedKeyCode = (int)(hash >> Character.SIZE);
2642
+ if (storedKeyCode == keyCode) {
2643
+ hashesToRemove.add(hash);
2644
+ }
2645
2646
+
2647
+ pressedKeys.removeAll(hashesToRemove);
2648
2649
keyPressed = !pressedKeys.isEmpty();
2650
keyReleased(keyEvent);
2651
0 commit comments