6 ms·
I wrote a (userland) general purpose and driver/hardware-agnostic multitouch daemon w/ gesture support for Linux that works with the existing input stack (i.e.
by ComputerGuru 5y ago
I wrote a (userland) general purpose and driver/hardware-agnostic multitouch daemon w/ gesture support for Linux that works with the existing input stack (i.e. doesn’t require switching to libinputy but also supports it), if anyone is interested:
https://neosmart.net/blog/2020/multi-touch-gestures-on-linux/ https://neosmart.net/blog/2020/multi-touch-gestures-on-linux...
https://github.com/mqudsi/syngesture https://github.com/mqudsi/syngesture
The biggest benefit is that you can use drivers with actually correct acceleration curves like xf86-input-synaptics (if you’re on X11) instead of the offensively bad, NIH reimplementation that ships with libinput.
Oh wait, I’m on HN so I shouldn’t neglect to mention my project is written in rust!
- toomim 5y agoWoah, this solves the acceleration problem? I want to try it!! Thank you!
- ComputerGuru 5y agoYou’re most welcome. Please read the article before downloading or cloning from GitHub: this “solves” the acceleration issue by not breaking it in the first place; imho what libinput should have done by developing gesture support on top of the existing, working driver/hardware stack instead of throwing away the userland/kernel separation and all layers of abstraction. The linked project is only the userland daemon that uses the raw Linux Multitouch Protocol events to interpret gestures; to get the acceleration curves working again I recommend using this in conjunction with xf86-input-synaptics as your actual input driver (which provides the correct acceleration curves for compatible hardware - basically all touchpads since they all cloned synaptics’ hardware once upon a time - but doesn’t by itself have gesture support). Side note: Syngesture (this project) isn’t dependent on X11 or Wayland, but I don’t know if anyone has ported or will port xf86-input-synaptics to Wayland, which is/was pretty much developed along the same lines as libinput: rewrite everything from scratch without taking into account that some things you’re throwing out actually work really well (regardless of the fact that they are built for X11 or not), get rid of all abstractions that made it possible to plug in better components/replacements at various points in the stack, and without a concern for actual feature parity for what they are purportedly replacing.
- shatteredgate 5y ago>rewrite everything from scratch without taking into account that some things you’re throwing out actually work really well This is not what happened. The synaptics driver and libinput were/are maintained by the same person, who has written about it extensively and explained why the approach in the synaptics driver does not work well. Specifically, some of the problems with the synaptics driver have directly led to decisions in libinput. You may want to read some of their blog posts if you haven't: https://who-t.blogspot.com/2016/12/xf86-input-synaptics-is-not-synaptics.html https://who-t.blogspot.com/2016/12/xf86-input-synaptics-is-n... https://who-t.blogspot.com/2016/04/why-libinput-doesnt-have-lot-of-config.html https://who-t.blogspot.com/2016/04/why-libinput-doesnt-have-... https://who-t.blogspot.com/2016/03/why-libinput-does-not-have.html https://who-t.blogspot.com/2016/03/why-libinput-does-not-hav... It may seem like a good idea on its surface to have tons of abstractions and features and extension mechanisms, but that fades away when you get deal with the bug reports over a period of years and get to see all the problems it causes.
- frostwarrior 5y agoDoes it support three finger drag? It's the MacOS feature I miss the most.
- ComputerGuru 5y agoYou mean click with three fingers once and let go to initiate a drag, move the cursor with one finger on the touchpad to its destination, then click and let go with three fingers to end it? 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.
- weikju 5y ago> You mean click with three fingers once and let go to initiate a drag, move the cursor with one finger on the touchpad to its destination, then click and let go with three fingers to end it? 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).
- lapinot 5y agoA while since i used macos but isn't this the same action as taping then drag (eg down/up/down/drag/up)?
- pph 5y agoAfter a quick glimpse it seems this only supports simple actions upon registering a gesture, however it should be possible to extend for that use-case. 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).
- adisbladis 5y agoAs someone who absolutely despises libinput (I have an unsupported use-case which will never be supported) I applaud this effort. Thank you!
- matheusmoreira 5y ago> I have an unsupported use-case which will never be supported Can you please elaborate?
- fivre 5y agoNot OP, but when I tried Wayland way back when, I discovered that libinput didn't let you remap tap buttons, something Xorg does support. That feature is incredibly useful for me, since my touchpad has no physical buttons but does have a dedicated right-click zone, so it's useful to remap two-finger tap to middle-click, since I use that all the time for opening links in new tabs and pasting from the X buffer. The libinput dev's response was a combination of incredulity that someone wouldn't have physical buttons (in like 2014) and a statement that the project would never add this feature. I haven't gone back to Wayland since.
- heavyset_go 5y ago> remap two-finger tap to middle-click You can do this with libinput and Wayland.
- Chyzwar 5y agoI think now xorg is using libinput. https://youtu.be/HllUoT_WE7Y https://youtu.be/HllUoT_WE7Y
- 5e92cb50239222b 5y agoThat "dev" you're criticizing here has been developing libinput solo since the beginning. He asked for help numerous times and never received any. So either step up and do the work, or stop complaining. https://www.youtube.com/watch?v=HllUoT_WE7Y https://www.youtube.com/watch?v=HllUoT_WE7Y libinput is yet another of those fundamental libraries that receive almost no developer attention, but get all the blame when something goes wrong: https://xkcd.com/2347/ https://xkcd.com/2347/
- DerArzt 5y ago> Oh wait, I’m on HN so I shouldn’t neglect to mention my project is written in rust! Thanks for that, it gave me a chuckle.
- pantalaimon 5y agoIs this compatible with the new XInput 2.4 touchpad gestures? https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/merge_requests/18 https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/merge_...
- dannyobrien 5y agoIt’s a bit unclear from your description: does this support wayland?
- floatboth 5y agoNone of this stuff is necessary on wayland. All wayland compositors so far use libinput, so multi-touch support is great out of the box.
- jwatt 5y ago> The biggest benefit is that you can use drivers with actually correct acceleration curves I just checked, and libinput does have the correct "flat" acceleration curve as an option, so I think we're good. ;-) https://wayland.freedesktop.org/libinput/doc/latest/pointer-acceleration.html#ptraccel-profiles https://wayland.freedesktop.org/libinput/doc/latest/pointer-... Being more serious, that document has a bunch of graphs of libinput's acceleration curves for different devices. I'd love to see a write-up of the curves you've implemented and why they're superior in your opinion.
- meragrin_ 5y ago>> that works with the existing input stack >> you can use drivers with actually correct acceleration curves like xf86-input-synaptics Sounds like they did not implement any curves but are using existing ones in the drivers.
- jwatt 5y agoAh, looks like it. Thanks for pointing that out.