That’s a very good question as I didn’t consider stateful gestures (where state doesn’t reset when all fingers are removed). It can be shimmed (without touching the code) in the configuration file by replacing the invocation of xdotool (or whatever) with a wrapper script that provides state enabling a “toggle mousedown” rather than just explicit, separate mouseup and mousedown events but I wonder if there’s a clean way to model that into the event loop as serialized to/from the configuration file directly. Feel free to open a GitHub issue if you like.
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).
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.
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.
You are obviously used to the three finger way, and to each his own. But for me, having it described as “it's the equivalent of clicking-and-dragging with a mouse” makes me wonder why not just click and drag? But who knows? I’ll have to try it and see if I like it.
Good to know.
However, my post may have been unclear, I don't like the three-finger drag, so I'm not used to it, I'm just trying to find a reason why some people may like it, so I may not have the best ones.
The thing is that you don't "click" anything, you just put your three fingers on the touchpad and slide them around. Exactly the way you would scroll with two fingers: no clicking involved.
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
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.