Skip to content

Commit 8620520

Browse files
gitterrost4Paul Kramer
andauthored
Swipe-returning on a ghost key will now trigger the action of the ghost key. (#1158)
Co-authored-by: Paul Kramer <pk@cantamen.de>
1 parent d2ef4ae commit 8620520

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

app/src/main/java/com/dessalines/thumbkey/keyboards/NumericFrench.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ val FRENCH_NUMERIC_KEYBOARD =
7575
KeyItemC(
7676
center = KeyC("8", size = LARGE),
7777
topLeft = KeyC("\""),
78-
topRight = KeyC("'"),
78+
topRight = KeyC("'", swipeReturnAction = CommitText("\"")),
7979
bottomRight = KeyC("-"),
8080
bottom = KeyC("."),
8181
bottomLeft = KeyC("*"),

app/src/main/java/com/dessalines/thumbkey/ui/components/keyboard/KeyboardKey.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,9 +479,15 @@ fun KeyboardKey(
479479
) ?: (
480480
if (dragReturnEnabled) {
481481
val swipeDirection =
482-
swipeDirection(maxOffset.x, maxOffset.y, minSwipeLength, key.swipeType)
482+
swipeDirection(
483+
maxOffset.x,
484+
maxOffset.y,
485+
minSwipeLength,
486+
if (ghostKey == null) key.swipeType else SwipeNWay.EIGHT_WAY,
487+
)
483488
key.getSwipe(swipeDirection)?.swipeReturnAction
484489
?: oppositeCaseKey?.getSwipe(swipeDirection)?.action
490+
?: ghostKey?.getSwipe(swipeDirection)?.swipeReturnAction
485491
} else {
486492
null
487493
}

0 commit comments

Comments
 (0)