Helium314 / HeliBoard

Customizable and privacy-conscious open-source keyboard
Apache License 2.0
2.45k stars 97 forks source link

Word-movers are inverted for RTL #979

Open devycarol opened 4 months ago

devycarol commented 4 months ago

If cursoring through RTL text, the word-move keys go the opposite direction. This is sort of proper in a LTR context, where there's a good chance you want to go to the "next" word rather than the one strictly to the right. But probably not so in a fully RTL context (the icons are mixed up).

The cause/solution may be similar to the janky spacebar trackpad with RTL text.

codokie commented 4 months ago

IIRC the problem is that the direction is inferred from the currently selected subtype. The direction of the character before the cursor is not enough to solve this issue either when the text is bi-directional. I am not aware of a way to retrieve the text direction of the editor

devycarol commented 4 months ago

With the word-movers it seems to be Android's native behavior for Ctrl+Left/Right

Helium314 commented 3 months ago

Interestingly with arrow keys (even on a HW keyboard), Android automatically inverts the direction depending on character, so visually it's fine. When using Ctrl+arrows it's the same weird behavior as observed in this issue.

Possibly we could decide to invert the left/right depending on directionality of the next/previous character.