Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've shared my opinion before on why mouse/trackpad handling is terrible on most Linux distributions [0], thanks to a misguided obsession w/ rewriting the entire stack and throwing away vendor-provided acceleration curves (most recently in order to provide gesture support instead of just building it on top of the correct, working solution).

More importantly, there is a solution for fixing this and I've done my part by open sourcing a multi-touch gesture solution (userland daemon) that's driver-agnostic and runs on top of the vendor-provided drivers w/ their correct acceleration curves [1].

(But TBH I don't know if this applies to Apple's trackpad because I don't know if there are any first-party drivers w/ proper acceleration curves for Linux or if they've all been – unfortunately poorly – reverse engineered.)

[0]: https://neosmart.net/blog/multi-touch-gestures-on-linux/

[1]: https://github.com/mqudsi/syngesture/



Interesting. I came to accept the rewrite for libinput, considering it's being developed by the same developer as synaptics, and he/she who codes gets to decide whether to maintain something he/she considers a mess of course. However, the only possible reaction from my side was to leave behind what was causing physical pain for me and return to Mac OS. From past discussions ([1], [2]), it appears I'm far from the only one. I hope the extant desktop devs at Red Hat and elsewhere enjoy their big refactorings for the sake of it as a hobby (wayland, gnome, libinput, systemd) but man does it suck. It's such a regression I've given up any hope and think desktop Linux has already peaked around 2016-18.

[1]: https://news.ycombinator.com/item?id=35313903

[2]: https://news.ycombinator.com/item?id=35428847


You’re not the only one to express this sentiment; a lot of people grappling with the discontinuities in the X11 to Wayland migration (and the gnome 2 to gnome 3 to gnome 4) have been saying the same thing. And that’s just for cases where the same developers have decided to move on to a new approach and the community has begrudgingly agreed to march along.


Very cool. I am trying to compare the gesture support for syngesture and MacOS [0], which I have never used. In syngesture, it seems you can swipe left/right/up/down with 1-5 fingers.

In MacOS, there are additional things you can do.

* Spread or bring closer 2-4 fingers.

* Swipe from the edge to do a different action than swiping in the bulk of the pad.

Are there any system limitations on linux that prevent the implementation of such gestures?

[0] https://support.apple.com/en-ca/HT204895


I just want to add 3-finger drag-and-drop to the list. It's so useful and much easier than the double tap or holding down the button to move things or rectangle select, especially the latter because I don't like tap-to-click. I don't know why Apple moved it from the trackpad settings to the accessibility settings.


Same! Drives me crazy every time I have to set up a new Mac for myself (I'm a contractor and clients sometimes insist i use their hardware). I have to Google it every time.


Just fyi I replied to that here: https://news.ycombinator.com/item?id=36732918


Thanks for looking. There is no such fundamental limitation and the code was written to support these and other gestures in the future. However I don’t use those other gestures myself and had no motivation to write in support for them. (They might also not be particularly in demand by users as I’ve never been asked to add them.)

(Also, syngestures separately recognizes and supports both taps and swipes, and it supports both/either with anywhere from 1 to 5 fingers.)


Oh, I hardly doubt anyone needs that many gestures. But just for the sake of fun math. The MacOS page lists 15 gestures.

With syngestures, we can

* Tap with 1-5 fingers. (5 actions)

* Swipe with one finger (just the mouse) (1 action)

* Swipe with two fingers either horizontally or vertically (usually scroll) (2 actions)

* Swipe with 3,4,5 fingers either up/down/left/right (3x4=12 actions)

Total is 20 actions. So actually there are more possibilities with syngestures.


Hahaha I never thought of it like that! But to admit it myself and to my own detriment, having seen people so accustomed to their phones try to “pinch and zoom” in real life makes me think that no number of additional gestures will make up for not supporting the ones macOS/iOS does.


Is it possible to have Three-Finger Drag so that you don't need to click down on the pad?


Good question. There is no technical barrier since it is possible to generate a mouse down event separate from a mouse up event however currently events are generated after the gesture is complete (meaning mouse location has been lost).

It’s easy to separate that into pre- and post- hooks, but the most reliable method I found for counting fingers in a gesture is “the maximum number of fingers during the gesture at any point” as it allows for variations in timing, location, direction, etc of first, second, subsequent fingers for a multi-finger gesture (you can’t assume they’re all present from the very start or that one finger won’t accidentally be raised mid-gesture). I’d have to change that to “detect number of fingers within xx ms of start of gesture” but that is somewhat problematic because the cursor position actually changes in response to touch between when your fist finger touched the trackpad and the time when (in your example) the third finger was finally added to the gesture (even if that all takes place in “a split second”). So it can be done but you might need to be intentional about being more careful with your three-finger swipe-to-drag to ensure the cursor remains within the desired click area until your third finger has made contact with the trackpad and hover there a brief moment to allow the daemon to determine you’re not going to add a fourth finger to the mix (changing it to another gesture altogether).

It would be entirely possible to retroactively generate a mouse down event at the original gesture start (with the first finger) when the third finger is added and no fourth finger is added, but that might be jarring from a UX perspective (cursor moves out of the bounding rectangle then the drag starts some ms later).


I had written a Windows script for adding three-finger drag[0] that I use daily, perhaps it could provide some inspiration.

Basically, it is an independent subscriber to RawInput messages that only keeps track of whether or not to send three-finger drag, and posts emulated mouse messages using SendInput. I have a few other scripts that each run as independent userland processes that only monitors their own trigger and nothing else.

Tangentially, my TPMouse[1] script implemented inertia in a framerate-independent way so that it uses very little resource while having perfect simulation stability.

A previous discussion where I explained the analytic derivation for this low-resource exact-solution damped inertia can be seen in [10]

[0] https://github.com/EsportToys/PrecisionThreeFingerDrag/blob/...

[1] https://github.com/EsportToys/TPMouse

[10] https://old.reddit.com/r/Trackballs/comments/ym9q2t/tpmouse_...


Nice; I've been looking for a way to do two-finger-swipe -> Browser back/forward in Ubuntu/Pop for a few years now, and still haven't found a solution. Hoping this is it!


I think Firefox supports this natively, but it’s hidden behind a config option (dom.w3c_touch_events.enabled) and you need to enable XInput2 by setting the MOZ_USE_XINPUT2=1 environment variable


That was my own motivation and this should work for you out of the box. (just that the default/sample config file is for three finger swipe, not two.)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: