mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
fixes 779
This commit is contained in:
@@ -2635,8 +2635,17 @@ public class PApplet implements PConstants {
|
||||
keyPressed = true;
|
||||
keyPressed(keyEvent);
|
||||
}
|
||||
case KeyEvent.RELEASE -> {
|
||||
pressedKeys.remove(((long) keyCode << Character.SIZE) | key);
|
||||
case KeyEvent.RELEASE -> {
|
||||
List<Long> hashesToRemove = new ArrayList<>();
|
||||
for (Long hash : pressedKeys) {
|
||||
int storedKeyCode = (int)(hash >> Character.SIZE);
|
||||
if (storedKeyCode == keyCode) {
|
||||
hashesToRemove.add(hash);
|
||||
}
|
||||
}
|
||||
|
||||
pressedKeys.removeAll(hashesToRemove);
|
||||
|
||||
keyPressed = !pressedKeys.isEmpty();
|
||||
keyReleased(keyEvent);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user