Unexpected-Keyboard icon indicating copy to clipboard operation
Unexpected-Keyboard copied to clipboard

[BUG] Keyboard chooses wrong letters when swiping

Open 7danilo opened this issue 4 months ago • 3 comments

What's happening

When I swipe to type a letter, the keyboard sometimes picks the wrong one.

The Problem

Image

Let's say I want to type the letter 'c' by swiping from 'k':

When it works: (1) - I swipe directly from 'k' to 'c' -> keyboard types 'c' ❌ When it breaks: (2) - My finger curves from 'k', passes through 'b', then lands on 'c' -> keyboard types 'b' instead of 'c'

Why this happens

The keyboard decides which letter to type based on where your finger goes FIRST, not where it ends up. But people's fingers naturally move in curves, not straight lines.

The fix

The keyboard should update the selected letter while the finger swipes, not just select the FIRST one.

Details:

  • File: Pointers.java
  • Method: onTouchMove()
  • What to do: I still haven't figured this out. It probably needs to change ptr.value during the swipe, call _handler.onPointerFlagsChanged(true) to update it, and more to avoid breaking other gestures. You're welcome to help.

Why this matters

Fixing this will make swiping much more accurate.

7danilo avatar Aug 21 '25 12:08 7danilo

It's more complicated than this: If your finger curves too much, then the keyboard treats it as the "clockwise" or "counterclockwise" gesture. Your proposed fix might eliminate the use of these gestures.

Spike-from-NH avatar Aug 22 '25 09:08 Spike-from-NH

Thanks for your issue. This is a problem for me too.

onTouchMove stops updating ptr.value after passing through the letter b because it records gestures. You might either pass through b and go back to the center, which types B even if the travel was a curve.

To be fair, I'm not a fan of ptr.value and I think it should be removed at some point. The function apply_gesture already computes the value from the swiping direction in some cases. Perhaps you could change apply_gesture to compute the value again after a swipe ?

Note that ptr.gesture.current_direction() is not the current direction but the starting direction in the case of a swipe. You can also rename it.

Julow avatar Aug 22 '25 09:08 Julow

It's more complicated than this

yeah

actually who fails is the user not the program

This is a problem for me too

me too

i just use N S W E or NW NE SW SE

Depending of the key's exact position you can add more, in function of how easy is for you hand to do it right

in addition, in advance of a mistake, i try not to place together edit and not edit things

The true is that i rarelly miss to be able to use the 8 compass keys

simper66 avatar Sep 24 '25 16:09 simper66