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 d91ec9d9d..d25f7de07 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; }