From 08f194a369aec18b4bcd6e9be3aa02bb58e44a12 Mon Sep 17 00:00:00 2001 From: Helium314 Date: Fri, 21 Jun 2024 15:13:13 +0200 Subject: [PATCH] block key swiping while using sliding key input fixes #892, which also contains the fix by @devycarol --- .../java/helium314/keyboard/keyboard/PointerTracker.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/helium314/keyboard/keyboard/PointerTracker.java b/app/src/main/java/helium314/keyboard/keyboard/PointerTracker.java index b08220422..6feb056a3 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/PointerTracker.java +++ b/app/src/main/java/helium314/keyboard/keyboard/PointerTracker.java @@ -870,7 +870,8 @@ public final class PointerTracker implements PointerTrackerQueue.Element, final Key oldKey = mCurrentKey; final SettingsValues sv = Settings.getInstance().getCurrent(); - if (oldKey != null && oldKey.getCode() == Constants.CODE_SPACE) { + // todo (later): move key swipe stuff to a separate function (and finally extend it) + if (!mIsInSlidingKeyInput && oldKey != null && oldKey.getCode() == Constants.CODE_SPACE) { // reason for timeout: https://github.com/openboard-team/openboard/issues/411 final int longpressTimeout = 2 * sv.mKeyLongpressTimeout / MULTIPLIER_FOR_LONG_PRESS_TIMEOUT_IN_SLIDING_INPUT; if (mStartTime + longpressTimeout > System.currentTimeMillis()) @@ -899,7 +900,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element, return; } - if (oldKey != null && oldKey.getCode() == KeyCode.DELETE && sv.mDeleteSwipeEnabled) { + if (!mIsInSlidingKeyInput && oldKey != null && oldKey.getCode() == KeyCode.DELETE && sv.mDeleteSwipeEnabled) { // Delete slider int steps = (x - mStartX) / sPointerStep; if (abs(steps) > 2 || (mInHorizontalSwipe && steps != 0)) {