OSX users will miss the three-finger-drag feature when switch to Linux. With that feature, you can easily select text or drag something around. On Linux, there are two common options to achieve this:
set the following options in xorg.conf and you get three-finger-drag
Option "SwipeUpButton" "1"
Option "SwipeDownButton" "1"
Option "SwipeLeftButton" "1"
Option "SwipeRightButton" "1"
The problems of mtrack are:
libinput-gestures do not natively support three-finger-drag. You need to use this fork three-finger-drag fork which is mentioned in this libinput-gestures three-finger-drag issue. As the author of libinput-gestures replied, libinput-gestures won't support three-finger-drag due to "To implement this would be messy, require significant processing overhead, and is discordant with the current design.".
so if you use the three-finger-drag fork of libinput-gestures:
gesture swipebegin all 3 xdotool mousedown 1
gesture swipeend all 3 xdotool mouseup 1
gesture swipeupdate all 3 xdotool mousemove_relative -- x y
So with this tool, you can use three-finger-drag with libinput(the underlying tool libinput-gestures based on). You probably will use it with libinput-gestures side by side to add three-finger-drag support.
1. clone the repo
2. install libinput(you probably have it already)
3. install xdotool(which includes libxdo)
4. cargo build --release
5. copy target/release/libinput-three-finger-drag to somewhere
6. disable 3 finger swipe gesture in libinput-gestures, see below
7. run libinput-three-finger-drag and check whether it works
8. make libinput-three-finger-drag auto-start
1. download precompiled binary from release page
2. disable 3 finger swipe gesture in libinput-gestures, see below
3. run libinput-three-finger-drag and check whether it works
4. make libinput-three-finger-drag auto-start
You can specify an acceleration value as a parameter, which will be multiplied with all 3-finger gesture movements:
libinput-three-finger-drag 1.4
Modify libinput-gestures config file /etc/libinput-gestures.conf or ~/.config/libinput-gestures.conf. Add finger_count 4 to essentially disable 3 finger swipe.
change
gesture swipe up xdotool key super+Page_Down
to
gesture swipe up 4 xdotool key super+Page_Down
Just like libinput-gestures. Fork
libinput debug-events
and read the output, which is trackpad "raw events". Filter out events of GESTURE_SWIPE_BEGIN, GESTURE_SWIPE_UPDATE and GESTURE_SWIPE_END. Simulate mouse_down on BEGIN, mouse_relative_move on UPDATE and mouse_up on END with libxdo. These three mouse action simulate a three-finger-drag. Call libxdo is more efficient than fork xdotool like libinput-gestures does. Especially when processing GESTURE_SWIPE_UPDATE events which is more frequent than BEGIN and END.