Skip to content
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

Add slide selection and deletion #424

Merged
merged 7 commits into from
Sep 20, 2023

Conversation

storvik
Copy link
Contributor

@storvik storvik commented Sep 19, 2023

First of all, congrats on releasing v2.0.0. Emoji support is a great addition to the keyboard!

I've been working on slide selection and deletion. Implemented it first via keypress (Shift + arrows). That didn't work in every app so I tried to use ime functions. It seems like the current implementation is working ok, but please test it. Hard to find every bug as some apps behave differently. I introduced a new type, selection. This was just to keep things a little simpler, not having to pollute the keyBoardKey with several variables related to selection.

Maybe the value 255 on line 195 and 257 should be larger. It was set this small in order not to slow down execution. I have since changed the code to not call it more than once per selection, so it probably can be set higher without impacting execution time.

This pull request also resets multitap actions after sliding.

Selection:
ThumbKeySelection

Deletion:
ThumbKeyDelete

@LenzGr
Copy link

LenzGr commented Sep 19, 2023

Nice! I was about to suggest slide deletion as implemented here - this is more familiar for GBoard users like myself that prefer swiping over typing 👍

@storvik
Copy link
Contributor Author

storvik commented Sep 19, 2023

Forgot to say that slide to delete works by sliding on the delete key.

Selection on spacebar slide works by sliding upwards and then horizontally. That way its easy to slide back to something you want to change, slide up and slide horizontally to select text. Then you can delete or start typing.

Both of these examples are in the gifs above

@sslater11
Copy link
Contributor

Wow this is so cool! I was going to attempt this myself, but couldn't think of a good way to do the selection. Swiping up is a great idea! I just tested it and it's working perfectly, and feels really smooth.

@storvik
Copy link
Contributor Author

storvik commented Sep 19, 2023

Thanks for testing @sslater11! Btw, nice work on the emoji picker 🎉

@KraXen72
Copy link
Contributor

this is great!
however, personally i'm concerned if it's still possible to preserve the ability to do many quick swipes on delete to delete a bunch of words, instead of this? i really like the selection part though.

@storvik
Copy link
Contributor Author

storvik commented Sep 20, 2023

@KraXen72 I tried to increase threshold for "activation" of selection when sliding to delete. This is currently set to an factor of slide sensitivity, which is working for me. Now I can swipe to delete word and slide to delete backwards. The consequence is that I have to slide a little longer before slide to delete activates. Note that if slide sensitivity is set very low, < 10, its hard to swipe.

We could of course make another entry in settings, but I think it's better to not clutter the settings menu with many similar options. What do you think @dessalines ?

@KraXen72
Copy link
Contributor

ah okay. this is good. not sure how intuitive it is, but it sounds pretty easy for users to find out on their own without instructions. although, it should be disable-able if somebody wants to.

Copy link
Owner

@dessalines dessalines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works well and is really intuitive, thx!

Be sure to add how to use this on the README user guide section.

@storvik
Copy link
Contributor Author

storvik commented Sep 20, 2023

@dessalines moved start selection code into own function. Also looked into hints from android studio and resolved them. I'm usually working with Emacs and languages without such tooling, therefore I tend to forget that they exist. Thanks for the feedback!

Will add it to the README!

Copy link
Owner

@dessalines dessalines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great, thx!

EDIT: in the future, just merge from main rather than rebasing, because rebase rewrites history and breaks collaboration for anyone else who has pulled down your changes.

@dessalines dessalines merged commit e11c2fa into dessalines:main Sep 20, 2023
1 check passed
@storvik storvik deleted the feature-sliding-mark branch October 9, 2023 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants