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
Android: Improved multi-touch #1783
Conversation
Thanks, but I'm not totally sure what's the motivation behind this one. Please add a small description. I assume it refers to the default values for cancelled touch events? |
Updated the description to provide some detail. |
Converted back to draft to make some extra changes |
Seems one check failed due to network error and not my code changes. |
PR should be ready now. Cancelled events are generated for every pointer now. This seems to be the better approach, since it is more clear to the user that the moment a cancelled event is generated its generated for all fingers instead of a non existing one. |
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.
Looks good overall, a few points are open and I would be also interested a bit in compatibility with other backends (ie iOS) regarding semantics.
- If possible is there a way to shrink the code a bit as the branches often only differ in small details?
- Do you know by chance how the cancelled case is handled on iOS? Single event vs multiple events, default values, etc?
cc @francesca64
Did some clean up to reduce code bloat and changed the feature matrix back to its original formatting. I guess I should leave cancelled how it is? |
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.
Thanks for the PR! The semantics look good. Could you add a CHANGELOG entry, so users know about this cool change?
So there already was a mention of Android multi-touch in the change log and since it was still in unreleased I just added some detail instead of making an extra entry. |
Sorry, I didn't realize there was already an unreleased entry for multi-touch! I think it'd actually be better not to touch the CHANGELOG then, since the issue in question was never released. |
Ooh okay, let me undo my change. |
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.
Looks great! We'll merge once CI finishes.
In the previous implementation of multi-touch there was a issue. When having two fingers on the screen and you would release one it would result in ended events being generated for all fingers even though not all fingers were lifted. This implementation will generate started and ended events for the right finger id's. Furthermore this implementation will generate a cancelled event with different defaults. These defaults should be according to spec since the user shouldn't preform any action it would normally perform: "You will not receive any more points in it. You should treat this as an up event, but not perform any action that you normally would" according to the ndk documentation.
cargo fmt
has been run on this branchcargo doc
builds successfully