Helium314 / HeliBoard

Customizable and privacy-conscious open-source keyboard
Apache License 2.0
1.83k stars 67 forks source link

horizontal cursor movement breaks emoji #859

Closed 0x-voidptr closed 2 weeks ago

0x-voidptr commented 3 weeks ago

Describe the bug Using the cursor movement feature of the horizontal spacebar swipe gesture around emojis will sometimes place the cursor in a spot where any typing will break the emoji. I believe this is because the cursor is being aligned to the byte rather than to the character/codepoint.

To Reproduce Type out a few emojis and swipe into the middle, then try to type something. Around half of the time it will break.

Expected behavior Expected: 😊😊t😊😊 Result: 😊😊īŋŊtīŋŊ😊

App version Version 1.3, via f-droid

Device:

ccoVeille commented 3 weeks ago

I'm also experiencing this issue.

Same configuration: stock Android 14

Helium314 commented 2 weeks ago

This is essentially the same as #22. Should be easy to somewhat improve (do the swipe in codepoints instead of chars), but hard to really fix, because there are also multi-codepoint emojis. And whether those display as a single emoji or multiple depends on your Android version

0x-voidptr commented 2 weeks ago

the left/right toolbar key functionality appears to work as expected for both the simpler cases and the more complex ones in the issue above. using this method to fix cursor movement issues seems straightforward in theory, although extending this fix to backspace behaviour may prove more complicated

Helium314 commented 2 weeks ago

I don't remember exactly, but I think there were issues when spamming left/right key events as part of such fast cursor movement (and in general, sending key events is discouraged)

ccoVeille commented 2 weeks ago

No more bug for me in 2.0-beta2