ClementGre / ThreeFingerDragOnWindows

Enables macOS-style three-finger dragging functionality on Windows Precision touchpads.
https://apps.microsoft.com/detail/9MSX91WQCM2V?
MIT License
602 stars 40 forks source link

Ignore dragging when scrolling #19

Closed klkvsk closed 1 year ago

klkvsk commented 1 year ago

I just started using ypur app and it's great. However, touchpad on my device is rather big, and sometimes when I scroll, I can accidentally touch it somewhere with my palm. The app registers three points of contact and starts dragging, all while scrolling is still active too.

My proposed solution is to only engage dragging when there was no movement since the first finger touched. I think you will agree, every time you intent to start dragging, you remove all fingers and then put all three on a touchpad. If we ignore cases when there was something done with one/two fingers, before third was added, that will cancel out any non-intentional drags.

ClementGre commented 1 year ago

Hi @klkvsk,

I agree with your solution, and I just realised that this is the behaviour of the Apple trackpads, except that the drag can be engaged even if one finger was moved before, but it dones't works when two fingers were moved.

I guess taking the same behaviour of Mac OS will be enough, we'll test. I currently don't have access to a Windows laptop, but I'll try in the next month to make a special version for you to test it.

Thank you for helping me improving this tool !

klkvsk commented 1 year ago

Thanks! Also, I want to add, a similar improvement can be done with discarding 4th finger while dragging. I have 4-finger gestures enabled, BUT while dragging with 3 fingers and then putting 4th, those 4-finger gestures do not engage. So I believe Windows discards 4-finger after 3-finger gestures by a similar logic discussed above. However, the cursor stops, and I think this is because TFDoW is skipping any input with more than 3 points of contact . I think it is safe to change the logic to keep dragging if we're already dragging, even if additional contacts appear.

ClementGre commented 1 year ago

Yes, your right, and this is the exact behaviour of Macos trackpads, so I'll add this improvement too.

klkvsk commented 1 year ago

I wrote my own version from scratch. It handles conflicting cases described above, and some more. Check it out: https://github.com/klkvsk/precise-three-fingers-drag

And I did not include mouse speed adjusting, because it looks like injected mouse moves already match real ones in terms of speed and acceleration. But maybe it depends on hardware/software settings. Need more reports.

ClementGre commented 1 year ago

ThreeFingersDragOnWindows v2.0 has just been released. In this release, the dragging algorithm have been redeveloped from scratch, addressing this issue (drag won't start if the fingers have started to move with only two fingers or four fingers, and the drag will continue if a fourth finger is added, or if only two fingers are kept on the touchpad). See release v2.0.1 Enjoy!