From 04ace4da41687263cecfba04e23a347182dc8f1e Mon Sep 17 00:00:00 2001 From: Joacim Breiler Date: Thu, 14 Mar 2024 16:43:43 +0100 Subject: [PATCH] Attempt to fix keyboard jog shortcut getting stuck --- .../core/services/ContinuousActionShortcutListener.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ugs-platform/ugs-platform-ugscore/src/main/java/com/willwinder/ugs/nbp/core/services/ContinuousActionShortcutListener.java b/ugs-platform/ugs-platform-ugscore/src/main/java/com/willwinder/ugs/nbp/core/services/ContinuousActionShortcutListener.java index d91ec9d9db..d25f7de072 100644 --- a/ugs-platform/ugs-platform-ugscore/src/main/java/com/willwinder/ugs/nbp/core/services/ContinuousActionShortcutListener.java +++ b/ugs-platform/ugs-platform-ugscore/src/main/java/com/willwinder/ugs/nbp/core/services/ContinuousActionShortcutListener.java @@ -110,16 +110,16 @@ public boolean dispatchKeyEvent(KeyEvent keyEvent) { } // On any key release we should abort a long pressed executor - if (keyEvent.getID() == KEY_RELEASED && executor.isLongPressed()) { - executor.release(); + if (keyEvent.getID() == KEY_RELEASED) { + executor.keyReleased(keyEvent); keyEvent.consume(); return false; } - // Try to find an continuous action for the current keys + // Try to find a continuous action for the current keys String keyAsString = getKeyAsString(keyEvent); Optional actionById = getContinuousActionByShortcut(keyAsString); - if (!actionById.isPresent()) { + if (actionById.isEmpty()) { return false; }