lokxii / Mac-trackpad-mapper

A utility for Mac that maps finger position on trackpad to cursor location on Scnreen
MIT License
28 stars 3 forks source link

Scrolling moves mouse cursor #5

Closed Axilotl17 closed 1 year ago

Axilotl17 commented 1 year ago

I think this is due to 1d7239c72ab96c7d22a414a0e440bd68e98ea755; now when scrolling with 2 fingers, the cursor also moves; which, I agree is intuitive, practically feels really bad in use.

lokxii commented 1 year ago

Even if I revert this commit, the cursor also teleports at the start and the end of gesture. Still trying to come up with some solutions

lokxii commented 1 year ago

a work around is to create a dead zone and do all the gesture there

lokxii commented 1 year ago

introduced dead zone in ac4341f3a9c49b8aef97907a9253b493942049ec. Gestures can be done there without moving cursor. Keeping this opened until I find a way to handle gesture in non dead zone areas

lokxii commented 1 year ago

So the problem is since we are reading raw touch events, we react to them before gesture (scrolling) events are emitted. Current solutions are:

  1. identify the gesture ourselves from raw touch events
  2. revert back to mapping cursor only after mouse events are emitted. Here we can probably lock cursor when gestures happens

I prefer option 1 but I have no idea how to implement it.

lokxii commented 1 year ago

problem solved in 180cc974b6ff8b1116129e8e0ecc3fd57c708adb So basically we just have to wait 1 callback cycle and see if any more fingers placed on touchpad. If so, we say it's a gesture and lock the cursor