-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Drag-and-return & Circular drag #854
Implement Drag-and-return & Circular drag #854
Conversation
4f32d00
to
7dc2227
Compare
Thank you so much for implementing this! I've been missing this feature ever since I switched away from MessagEase, but hadn't found the time yet to implement it myself 😄 I have the feeling that the gestures are sometimes quite "strict". It happens to me quite often that a circle is interpreted as a drag-and-return, unless I try really hard to draw a perfect circle. Or, for the drag-and-return: if the return-part of my gesture overshoots the original key, the opposite letter gets typed (for example, when I want to type capital I'm not quite sure how to improve this, but if it helps, I can attach a debugger to my phone to try out some gestures, so we can link the recorded positions to expected results, to build a (unit-)test set 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx! Everything works pretty well, except the circle-and-drag is very touchy.
app/src/main/java/com/dessalines/thumbkey/ui/components/settings/behavior/BehaviorActivity.kt
Show resolved
Hide resolved
app/src/main/java/com/dessalines/thumbkey/ui/components/keyboard/KeyboardScreen.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/dessalines/thumbkey/ui/components/keyboard/KeyboardKey.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/dessalines/thumbkey/ui/components/keyboard/KeyboardScreen.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Do you want to try tweaking the circle-and-drag now, or do that later?
app/src/main/java/com/dessalines/thumbkey/ui/components/keyboard/KeyboardScreen.kt
Show resolved
Hide resolved
I don't really have time for it right now, so the earliest I'd commit something regarding that is tomorrow. |
Up to you, its no rush obvi. |
The DB stuff is good here, and we can always tweak later. Thx a ton for this! |
The bug was introduced in commit 0ab4b98 (Implement Drag-and-return & Circular drag (dessalines#854)). It was caused by an assumption that the numeric mode of a layout would have at least a one-to-one relation to its main or shifted modes. In this case, the Japanese main/shifted modes have more keys than the numeric mode, which caused an index error.
The bug was introduced in commit 0ab4b98 (Implement Drag-and-return & Circular drag (dessalines#854)). It was caused by an assumption that the numeric mode of a layout would have at least a one-to-one relation to its main or shifted modes. In this case, the Japanese main/shifted modes have more keys than the numeric mode, which caused an index error.
The bug was introduced in commit 0ab4b98 (Implement Drag-and-return & Circular drag (#854)). It was caused by an assumption that the numeric mode of a layout would have at least a one-to-one relation to its main or shifted modes. In this case, the Japanese main/shifted modes have more keys than the numeric mode, which caused an index error.
This implements drag-and-return and circular drag functions inspired by MessagEase.
These functions were essential to my workflow before I switched to thumb-key, so I figured I'd reimplement them here.
I'm sure some parts of the code could be improved, and I don't really like the implementation detail of having to pass the additional keys of the other keyboard layers to each key (as
secondaryKey
andtertiaryKey
), but this seems like the easiest implementation with regard to the current architecture of thumb-key.Drag-and-Return
Lets you drag in direction of one the edges/corners of a key and back to the center in order to send the key on that edge/corner in the opposite case, so uppercase if the keyboard is currently lowercase, or lowercase if the keyboard is currently uppercase.
Note that this technically just switches between the
main
andshifted
keyboard layout, so it will just send whatever is at the corresponding position of the equivalent keyboard.Circular drag
Lets you drag in a circle starting and ending on the same key in order to send either the center key in the opposite case (
main
vsshifted
layout), or send the number at the corresponding position of the key (numeric
layout).The circle detection code is completely improvised and could probably use some improvements, but in my testing, both drag-and-returns and circular drags were detected almost flawlessly.