-
Notifications
You must be signed in to change notification settings - Fork 217
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
Added ghost key functionality. #961
Conversation
…are not visible, but exist in the corresponding location in the numerical view.
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, see comments below. Also run ./gradlew formatKotlin
to pass lint.
): SwipeDirection? { | ||
val xD = x.toDouble() | ||
val yD = y.toDouble() | ||
|
||
val swipeLength = sqrt(xD.pow(2) + yD.pow(2)) | ||
|
||
val compositeSwipeType = |
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.
This seems a bit overkill. If ghost keys are enabled, its probably simple enough to just make it EIGHT_WAY
app/src/main/java/com/dessalines/thumbkey/ui/components/settings/behavior/BehaviorActivity.kt
Show resolved
Hide resolved
@@ -362,8 +364,19 @@ fun KeyboardScreen( | |||
Row { | |||
row.forEachIndexed { j, key -> | |||
Column { | |||
val ghostKey = |
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.
The ghost keys should probably be defined in the keyboard definitions themselves, but this is much simpler.
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.
Hmm, yeah, maybe. I assume by this you mean a KeyItemC
should have an optional reference to another KeyItemC
, rather than a KeyItemC
having, for example, a ghostSwipes
entry (analogous to swipes
)?
I would think it's kind of strange to have a ghostSwipes
entry, since then you could put any key down. It feels to me like, if you wanted to do that, you should just define them in swipes
, rather than using ghost keys to override the numeric key in the same position.
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.
For sure, an additional layer to swipes, or another map. No changes needed for this tho, its good.
app/src/main/java/com/dessalines/thumbkey/ui/components/keyboard/KeyboardKey.kt
Show resolved
Hide resolved
Updating ghost keys branch
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.
Works great, nice job.
### Ghost keys | ||
|
||
Enabling `Ghost keys` in keyboard settings will enable swiping hidden symbol keys without switching to the numeric layout. | ||
|
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
name = "ghost_keys_enabled", | ||
defaultValue = DEFAULT_GHOST_KEYS_ENABLED.toString(), | ||
) | ||
val ghostKeysEnabled: Int, |
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.
I tested locally, as is necessary for migrations, and this worked. Nice job.
@@ -362,8 +364,19 @@ fun KeyboardScreen( | |||
Row { | |||
row.forEachIndexed { j, key -> | |||
Column { | |||
val ghostKey = |
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.
For sure, an additional layer to swipes, or another map. No changes needed for this tho, its good.
One feature I missed from MessagEase when I switched to thumb-key was that you could swipe the hidden "ghost key" symbols located in the numerical view even from the alphabetical view, provided you knew where they were. I added this functionality for myself, but then added a settings option for it to make it configurable. I'm sharing in case you want to upstream this into the main version but totally up to you :)
The default is to deactivate this setting, so it's an opt-in feature
I have only added the string resource for English, since I don't know a good way to translate this concept.
I've written database migration logic to upgrade to the new version