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

Speed up delete button as user continues to hold #147

Closed
2 tasks done
andrewtavis opened this issue Mar 13, 2022 · 17 comments
Closed
2 tasks done

Speed up delete button as user continues to hold #147

andrewtavis opened this issue Mar 13, 2022 · 17 comments
Assignees
Labels
feature New feature or request good first issue Good for newcomers

Comments

@andrewtavis
Copy link
Member

andrewtavis commented Mar 13, 2022

Terms

Description

It would be good if Scribe's delete button would speed up as the user holds it for longer, as this is a feature of system keyboards. This would be done by editing keyLongPressed in KeyboardViewController.swift.

Contribution

This isn't a priority as of now. Someone is welcome to work on it if they'd like, or I'll get to it later :)

@andrewtavis andrewtavis added feature New feature or request good first issue Good for newcomers labels Mar 13, 2022
@andrewtavis andrewtavis changed the title Speed up delete button hold deletion speed Speed up delete button as user continues to hold Mar 13, 2022
@AE542
Copy link

AE542 commented Mar 24, 2022

Hi there, I'd like to have a go with this issue. Could I ask, when you mean speed up the delete button, is it the animation thats tied to it?

@andrewtavis
Copy link
Member Author

Hi @AE542, thanks for reaching out! There's no animation that's tied to it. Basically what we're talking about is that self.handleDeleteButtonPressed() is being passed within keyLongPressed. The interval for this is defined above repeat every 0.1 seconds in backspaceTimer = Timer.scheduledTimer(withTimeInterval: 0.1, repeats: true).

It would be great if the time interval would react to the amount of time that the user has held the delete button, with this speeding up a bit if the user is holding it for longer. I don't think it needs to delete word by word as the system keyboard does, but it should just go a bit faster so the user doesn't have to wait if they're deleting a whole paragraph. Basically we're trying to increase the withTimeInterval value over time 😊

Would be happy to discuss this further, and thanks so much for volunteering to help!

@andrewtavis
Copy link
Member Author

andrewtavis commented Mar 24, 2022

Also, looking at your work, I was thinking that a version of Nankaimo would be really cool and expansive if you used Wikidata as the backend like Scribe. Currently there's not very much Japanese data on there (see the nouns query), and not sure what your data source is right now, but when it eventually expands you could have it work for tons of words and have a very simple update process 😊 You mentioned testing for that app as well, so feel free to check out #8 :)

@AE542
Copy link

AE542 commented Apr 3, 2022

Sorry for the late reply but I’d like to have a go at tackling this over the week. There’s a way to speed up the time interval depending on the users buttons press I think.

@AE542
Copy link

AE542 commented Apr 3, 2022

Also, looking at your work, I was thinking that a version of Nankaimo would be really cool and expansive if you used Wikidata as the backend like Scribe. Currently there's not very much Japanese data on there (see the nouns query), and not sure what your data source is right now, but when it eventually expands you could have it work for tons of words and have a very simple update process 😊 You mentioned testing for that app as well, so feel free to check out #8 :)

Ah yeah there’s no data source as the user makes there own one. It’s more like a personal collection of words a user sees in Japanese and adds them when they want to, to eventually test themselves. It does need an overhaul eventually. Scribe is an interesting solution though I’ll check it out!

@andrewtavis
Copy link
Member Author

Sorry for the late reply but I’d like to have a go at tackling this over the week. There’s a way to speed up the time interval depending on the users buttons press I think.

Not a problem on the late reply! You’re welcome to send a PR, and let me know if you have any questions :)

I’ll assign it to you now 😊

@andrewtavis
Copy link
Member Author

andrewtavis commented Apr 3, 2022

Also, looking at your work, I was thinking that a version of Nankaimo would be really cool and expansive if you used Wikidata as the backend like Scribe. Currently there's not very much Japanese data on there (see the nouns query), and not sure what your data source is right now, but when it eventually expands you could have it work for tons of words and have a very simple update process 😊 You mentioned testing for that app as well, so feel free to check out #8 :)

Ah yeah there’s no data source as the user makes there own one. It’s more like a personal collection of words a user sees in Japanese and adds them when they want to, to eventually test themselves. It does need an overhaul eventually. Scribe is an interesting solution though I’ll check it out!

Ya maybe you could use some of the Japanese queries in scribe_data/extract_transform/Japanese as a basis later on when the coverage is better. We could keep an eye on how the data expands in the future and go from there :)

@andrewtavis
Copy link
Member Author

Thanks for your willingness to help!! :)

@AE542
Copy link

AE542 commented May 1, 2022

@andrewtavis
Hi I've been tackling this on and off. Sorry for not contacting you sooner! I have found a way to get the deletion to work the longer the button is pressed but its causing the Scribe autosuggestion bar to disappear above the keyboard.
Simply adding creating a variable to handle the keyboard deletion using a UILongPressGestureRecognizer, it deletes faster if the user is pressing the deletion button:

    let longPressRecognizer = UILongPressGestureRecognizer(target: self, action: #selector(self.keyLongPressed(_:)))
      keyboardKey.delete(longPressRecognizer)

Just for trying this out it works if put in viewDidLoad() but unfortunately this error comes up;

13:29:56.468081+0100 News[3504:94091] [lifecycle] [u C9F8712E-8337-4A58-9C11-C60868A750B7:m (null)] [org.scribe.spanish(1.3.4)] Connection to plugin interrupted while in use.

I'll keep working on this when I have time!

@andrewtavis
Copy link
Member Author

Hi @AE542 :)

All fine on the timing! No stress whatsoever 😊 Let me know if you'd like me to look at something for this. I'm in the process of looking into Scribe-Android at the moment as there's interest for a conference I have coming up, but am very much happy to help you with this!

Wishing you all the best!

@andrewtavis
Copy link
Member Author

Hi @AE542, checking in with you on the status of this :) Let me know if there's anything I can do to help 😊

@AE542
Copy link

AE542 commented Aug 21, 2022

Apologies for the late reply. I couldn't solve this issue. Just didn't get the time to get it done. Sorry for using up your time on this. Could I ask how you got it solved if you don't mind? Thanks.

@andrewtavis
Copy link
Member Author

Hi @AE542, don’t worry whatsoever! All good, and communicating with you on it was a nice use of my time 😊 This issue is currently not resolved, so we’re going to have to get it it another time. Honestly this was quite difficult of an issue, and I could have done much more to support. If you wanted to try to resolve it, then we can at some point, or you’d be welcome to try another issue. Let me know if you have interest in this one or switching to another, and maybe we could do a quick call to discuss :)

@andrewtavis
Copy link
Member Author

Hope you’re well! 😊

@andrewtavis
Copy link
Member Author

@AE542, just wanted to let you know that I was able to figure this out 😊 You can check the commit ca63c77 to see how it's done. I basically counted the number of deletes, and then set up some break points where after 20 deletes the backspaceTimer is invalidated and replaced with a faster one, and once 50 deletes have occurred it speeds up even more :)

Will need to test it a bit, and you're welcome to give feedback on how fast it all's going!

My regards :)

@AE542
Copy link

AE542 commented Oct 30, 2022

Hi Andrew. This is awesome! I had a look at the commit and saw it was as simple as invalidating the timer with a var to hold the delete counts. Quite simple but it looks like it works! Sorry I couldn't be of much help. But thanks for reaching out about this! I'll have a look at other beginner issues and take a shot at them when I have time :). Thanks again

@andrewtavis
Copy link
Member Author

Happy to reach out, @AE542!! Let me know if you’d like a suggestion for an issue to try 😊

Hope you’re having a nice weekend :) :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants