Add basic double click recognition - #205
Open
Feksaaargh wants to merge 1 commit into
Open
Feksaaargh wants to merge 1 commit into
Feksaaargh wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit adds the ability for InfiniSim to fire the DoubleTap event at all, since it currently cannot.
This implementation is not accurate to actual hardware, which seems to "hold" sequences of taps and figure out what to do with them after taps stop coming in. If it's one tap it sends a normal tap, if it's two taps it sends a double tap, and if it's more then it does nothing (so if you tap the screen repeatedly, it does not send any gestures).
This behavior is verifiable in this example app: https://github.com/Feksaaargh/InfiniTime/tree/app-event-tester (note that the app also consumes button inputs, so you need to long press the button to exit it).
Another inaccuracy is that when double clicking, the first click will send a SingleTap and the second will send a DoubleTap, due to the lack of something like the aforementioned hold system. Hardware only sends the DoubleTap event. I'm not sure if this can be fixed without modifying the general control flow a good bit, since that would require the ability to send an event without direct user input (so some sort of asynchronous and cancellable wait or a system constantly polling/updating the input state).
For now though, I consider this a "good enough" solution to the problem.