rxhanson / Multitouch-Community

Issue and feature request tracking for the Multitouch app
https://multitouch.app
38 stars 0 forks source link

2 finger click gets triggered by resting finger + 1 click #82

Open Lefky opened 3 years ago

Lefky commented 3 years ago
Screenshot 2021-05-21 at 10 10 19

This is the configuration i have. But when I just do a left click while resting my right finger it also gets triggered resulting in sometimes not even registering a regular click.

rxhanson commented 3 years ago

Thanks for reporting.

As you have observed, Multitouch doesn't do any resting touch rejection on the Magic Mouse.

Simply put, this type of resting touch rejection would require a significant amount of time and engineering to implement properly (a bit outside of the resources of a lone indie dev :).

As a comparison, Apple's touch rejection is typically done using in house machine learning that has been perfected over the years by several engineers. Touch rejection is a pretty good topic for a research paper.

I did implement my own resting touch rejection algorithm for the trackpad when Multitouch is using Apple's private multi-touch framework since using that framework does not include the normal resting touch rejection from Apple. In the case of the Magic Mouse, resting touches are much more difficult to discern due to a smaller surface area and the likely position of resting touches being very similar to active touches. Provided that not all users hold the mouse identically, machine learning is likely the only good way to tackle this problem.

The most I would be willing to add to Multitouch at this time would be to allow a user to configure (via terminal command) how far in the from each edge of the mouse is registered as a touch. Right now just the very edge is ignored. I can add this into the next release if it's something desired.

Lefky commented 3 years ago

Hi

Thanks for the quick response. I think being able to have some form of resting touch rejection would be a great feature. Simply dividing the mouse in 2 separate areas would be enough for most people. Having the ability to configure something like 20% to the right/left would be even better. According to me the app would benefit from a feature like this :)

rxhanson commented 3 years ago

I went ahead and made a quick change & beta release that allows you to configure the left, right, and top bounds that Multitouch will recognize on the Magic Mouse. If you don't mind trying it out and providing feedback, I would appreciate it.

Here's the download link: https://www.multitouch.app/beta/multitouch1.24.12.dmg

To configure it, here are the following terminal commands: defaults write com.brassmonkery.Multitouch mouseLeftEdge -float 0.01 defaults write com.brassmonkery.Multitouch mouseRightEdge -float 0.99 defaults write com.brassmonkery.Multitouch mouseTopEdge -float 0.98

The values in those commands are the defaults, so if you just want 20% of the right edge ignored, then you can execute defaults write com.brassmonkery.Multitouch mouseRightEdge -float 0.8

Restart the app after executing the terminal command.

Lefky commented 3 years ago

I just tried with the following command defaults write com.brassmonkery.Multitouch mouseRightEdge -float 0.5 What I'm basically trying to do as a starting point is ignore 50% of the surface. But apparently resting touches still get registered. Tried applying 0.1 and that seems better, but I doubt that's the endgame here + the 2 finger click also doesn't work anymore then. Or do I also need to configure the leftedge for it to work?

EDIT: I did install the beta next to my regular install. So do I have to change the command then? Maybe that's the issue...

rxhanson commented 3 years ago

There's no need to keep the original - the beta is identical except that those values are configurable.

Make sure that you restart the app after executing the terminal command so that the changes take effect.

To see the touches that Multitouch is acting on, you can hold the option key in the menu bar menu and select Debug -> View Touches. If you've set mouseRightEdge to 0.8 then your right touch won't appear in the viewer unless it is to the left 80% of the mouse.

Lefky commented 3 years ago

Just tried with your new feedback. Resting touches are indeed ignored. But so are clicks now. I don't know if the mouse distinguishes clicks from touches (I would expect it to). So clicks should still be registered.

rxhanson commented 3 years ago

With that configuration in place, I would expect your two finger middle click configured in Multitouch to only work if you have moved your two touches to be within the area configured using that command. If one of your touches is outside of the area that has been configured to be recognized by Multitouch, then your click should be registered as a left click, as Multitouch will not have operated on the input of that touch.

It might take a little getting used to, since you have to actively know where you have set that bound to allow touches to be recognized by Multitouch, and therefore where a two finger click is going to be a middle click vs a left click.

Lefky commented 3 years ago

So a click won't be distinguished from a tap/resting touch? I would've expected apple to make that distinction. Shame. But then I prefer to keep using the default software. This is a good addition nevertheless. I'm 100% sure certain people will benefit from this. Thanks