Skip to content

Commit

Permalink
account for simultaneous down-events
Browse files Browse the repository at this point in the history
fix space and backspace literally not working
  • Loading branch information
devycarol committed Jul 3, 2024
1 parent b398d39 commit 482ae1e
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions app/src/main/java/helium314/keyboard/keyboard/PointerTracker.java
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,10 @@ private void onDownEventInternal(final int x, final int y, final long eventTime)
mIsAllowedDraggingFinger = sParams.mKeySelectionByDraggingFinger
|| (key != null && key.isModifier())
|| mKeyDetector.alwaysAllowsKeySelectionByDraggingFinger();
mKeySwipeAllowed = key != null && isSwiper(key.getCode()) && !sInGesture;
if (key != null && isSwiper(key.getCode()) && !sInGesture) {
mKeySwipeAllowed = true;
sInKeySwipe = true;
}
mKeyboardLayoutHasBeenChanged = false;
mIsTrackingForActionDisabled = false;
resetKeySelectionByDraggingFinger();
Expand Down Expand Up @@ -719,7 +722,7 @@ private boolean isSwiper(final int code) {

private void onGestureMoveEvent(final int x, final int y, final long eventTime,
final boolean isMajorEvent, final Key key) {
if (!mIsDetectingGesture) {
if (!mIsDetectingGesture || sInKeySwipe) {
return;
}
final boolean onValidArea = mBatchInputArbiter.addMoveEventPoint(
Expand Down Expand Up @@ -932,7 +935,6 @@ private void onMoveEventInternal(final int x, final int y, final long eventTime)

// todo (later): move key swipe stuff to KeyboardActionListener (and finally extend it)
if (mKeySwipeAllowed) {
sInKeySwipe = true;
onKeySwipe(oldKey.getCode(), x, y, eventTime);
return;
}
Expand Down Expand Up @@ -1031,10 +1033,12 @@ private void onUpEventInternal(final int x, final int y, final long eventTime) {

if (mKeySwipeAllowed) {
mKeySwipeAllowed = false;
mInHorizontalSwipe = false;
mInVerticalSwipe = false;
sInKeySwipe = false;
return;
if (mInHorizontalSwipe || mInVerticalSwipe) {
mInHorizontalSwipe = false;
mInVerticalSwipe = false;
return;
}
}

if (sInGesture) {
Expand Down

0 comments on commit 482ae1e

Please sign in to comment.