by weikju · 4y ago · 0 comments
Not quite.. on macOS, you can enable three-finger drag which means that when you touch down with 3 fingers and drag them on the trackpad, it's the equivalent of clicking-and-dragging with a mouse.
There's no laborious use three fingers then one then three again. Just like swiping with 2 fingers does scrolling, using 3 fingers just grabs whatever's under the cursor and moves it (whether that's a window, or starts selecting text, moves a scrollbar, anything).
In all cases, that is easier to implement in code than a stateful transition like I described since there is no state persisting beyond the gesture itself, it just needs gesture_start and gesture_end support (with the difficulty being in determine if a three-finger gesture has started or if it’s actually a three-finger gesture on its way into becoming a four-finger gesture).
I now find it less of an effort not having to press down to register a click. 3-finger-drag now makes for a more relaxed, less RSI prone experience for me.
On macOS the accuracy is pretty much the same as with a single finger. As in with a single finger you reliably point to a single pixel and with three fingers you can reliably point to a 2x2 area, even with them spread far apart.
(Not trying to dismiss anyone's effort, just pointing out that Mac trackpads set the bar really high.)
And there are techniques, like, when you need to be more accurate, instead of moving the three fingers, you move two of three or one of three, so the average position calculated by the trackpad still moves in the direction you intend, but slower and more accurately than moving the entire hand.
The gesture is very well implemented actually. It's surprisingly precise and feels really natural in the sense you could release and resume dragging even after all your fingers leave the touchpad. Nothing else comes close
I move the cursor over what I want to move, then click with my thumb and keep it pressed down. That initiates the drag. Meanwhile I can use my pointer finger to move the cursor wherever I want, dragging the whole time. Once I've moved the cursor to where I want, I remove my pointer finger so it stops moving and then release my thumb to drop.
Is it another way to do the same thing? Why would I use three fingers instead of just using a normal mouse click with my thumb?
I personally don't like this and very much prefer the "tap-hold with a small delay" for my dragging needs. I'm very happy to see this has been implemented on Linux, too.
To abstract it a bit: You would need to
1. Trigger an event on the gesture start (detect 3 fingers -> hold alt, mousedown)
2. Have mouse movement enabled
3. Trigger another event on gesture end (lift fingers -> mouseup, lift alt).
The solution is simple but somewhat ugly, just like on Android and iOS: set a maximum time limit (up to 250ms) before going with the number of fingers detected.
Also, I’m not sure if macOS is distinguishing between tap and click? The online documentation says it’s with force click enabled.