mirror of
https://github.com/SimpleMobileTools/Simple-Keyboard.git
synced 2025-02-17 04:10:40 +01:00
move the cursor more if the user does big swipes
This commit is contained in:
parent
2702350471
commit
eeb12143b0
@ -1372,11 +1372,15 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
|
|||||||
if (mIsLongPressingSpace) {
|
if (mIsLongPressingSpace) {
|
||||||
val diff = mLastX - mLastSpaceMoveX
|
val diff = mLastX - mLastSpaceMoveX
|
||||||
|
|
||||||
if (diff > SPACE_MOVE_THRESHOLD) {
|
if (diff < -SPACE_MOVE_THRESHOLD) {
|
||||||
onKeyboardActionListener?.moveCursorRight()
|
for (i in diff / SPACE_MOVE_THRESHOLD until 0) {
|
||||||
mLastSpaceMoveX = mLastX
|
|
||||||
} else if (diff < -SPACE_MOVE_THRESHOLD) {
|
|
||||||
onKeyboardActionListener?.moveCursorLeft()
|
onKeyboardActionListener?.moveCursorLeft()
|
||||||
|
}
|
||||||
|
mLastSpaceMoveX = mLastX
|
||||||
|
} else if (diff > SPACE_MOVE_THRESHOLD) {
|
||||||
|
for (i in 0 until diff / SPACE_MOVE_THRESHOLD) {
|
||||||
|
onKeyboardActionListener?.moveCursorRight()
|
||||||
|
}
|
||||||
mLastSpaceMoveX = mLastX
|
mLastSpaceMoveX = mLastX
|
||||||
}
|
}
|
||||||
} else if (!continueLongPress) {
|
} else if (!continueLongPress) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user