From 0bfa3d8dec72ff84030f45fe9a251c09244ca9f2 Mon Sep 17 00:00:00 2001 From: rishab Date: Fri, 7 Mar 2025 16:07:15 +0530 Subject: [PATCH] removed hash based key handling --- core/src/processing/core/PApplet.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index 24c0d5d39a..7d802b59eb 100644 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -2630,13 +2630,15 @@ protected void handleKeyEvent(KeyEvent event) { switch (event.getAction()) { case KeyEvent.PRESS -> { - Long hash = ((long) keyCode << Character.SIZE) | key; + Long hash = (long) keyCode; if (!pressedKeys.contains(hash)) pressedKeys.add(hash); keyPressed = true; keyPressed(keyEvent); } case KeyEvent.RELEASE -> { - pressedKeys.remove(((long) keyCode << Character.SIZE) | key); + Long hash = (long) keyCode; + pressedKeys.remove(hash); + keyPressed = !pressedKeys.isEmpty(); keyReleased(keyEvent); }