rynbrd / xf86-input-mtrack

Xorg Multitouch Trackpad Driver
GNU General Public License v2.0
355 stars 58 forks source link

New feature: ignore new touches at top edge. #115

Open mcourteaux opened 8 years ago

mcourteaux commented 8 years ago

I'm using this driver on my MacBook Pro. Very often I accidentally clicked using the side of my thumbs when I'm typing on the keyboard. I only touched the top 10% or something of the touchpad. So I added a new feature to be able to ignore new touches on the top of the touchpad.

Two new variables: TopEdge and IgnoreTop. I know this could have been done in one setting, however, it seems to be more generic towards to future to split the size and the behavior of it.

Edit: After using this for some time. I decided to add support for specifically ignoring the top corners, instead of the top edge. This also introduces two new variables: TopCorners and IgnoreTopCorners. This also showed there was a bug in the coordinate system. You forgot to subtract the minimum value of the coordinates (obtained through the capabilities). So right now, I'm subtracting the minimum before storing the coordinates in the struct Touch its x and y variables. I'm not sure if this breaks anything else (since coordinates are now always non-negative), but so far I'm not experiencing any problems. If this does break something, please let me know!

Note: my vim stripped the trailing spaces in the README.md file. I can't really undo that (because I hate nano).