Neighboring pixel suppression for better multi-touch gestures #205
+184
−3
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.
I was having issues with the Surface Laptop Studio 2 touch pad, where multi-touch gestures were nearly impossible to make work when your fingers are close together. I came up with the idea that one could find local maxima locations, and dim the neighboring pixels resulting in a more reliable way to use multi-touch gestures where fingers are close. Without code changes, the only way I was able to get somewhat decent support was to increase the neutral value offset by about 60 to 70.
This in turn introduced a ton of jitter, and required the activation and deactivation thresholds to be set extremely low when using the cursor. From there, I made an implementation which would start with a high neutral, then back it off if only one touch was detected. This helped, but was still pretty inconsistent and faced the same issues as just having a high neutral offset.
I've done a fair bit of testing with the touch pad with the pixel suppression, and had multiple people trying it out on my laptop. With the attached Surface Laptop Studio 2 configuration, it seems I am able to get a pretty much identical touch pad experience to when running in Windows, with no hiccups.
Perhaps there might be a better way to do this, but this seems to have done the trick for me - figured it would be worth sharing.