syngesture icon indicating copy to clipboard operation
syngesture copied to clipboard

Finetune sensitivity and treshold

Open smileBeda opened this issue 1 year ago • 4 comments

I am wondering if, and how, we could finetune sensitivity and treshold of the gestures? I am using this lib for the one and only purpose to bring two finger gestures (history back and forward) into gnome.

For some reason all other developers insist it is "impossible" to detect a horizontal two-finger gesture, however your implementation clearly proves otherwise, which is why I use it.

However, it is uncontrollable :D

  • it navigates back and forward way too fast, and uncontrollably (because the treshold is so little)
  • there are no finetune options in the config, as opposed to fusuma or just generally synaptics, which I am otherwise used to, and using actively along this very repo here.

Can you let me know if it is possible to finetune geseture treshold and sensitivity just for the gestures implemented in the syngestures?

My config is very simple as I need just the two finger swipes, the rest I do in fusuma (and synaptics):

##
# Part of a full "MacOS on Gnome X experience setting"
# Here we control only two finger gestures (navigation back and forward)
# Requires syngestures https://github.com/mqudsi/syngesture/
#
# Other settings and controls done with:
# Fusuma https://github.com/iberianpig/fusuma, xdotool
# libinput-three-finger-gestures https://github.com/marsqing/libinput-three-finger-drag
# synaptics https://wiki.archlinux.org/title/Touchpad_Synaptics
# Kinto https://github.com/rbreaves/kinto
# Xorg
##
[[device]]
device = "/dev/input/by-path/pci-0000:04:00.1-usb-0:5:1.2-event-mouse"# Edit as required
gestures = [
	# Navigate next
	{ type = "swipe", direction = "right", fingers = 2, execute = "xdotool key alt+Left" },
	# Navigate previous
	{ type = "swipe", direction = "left", fingers = 2, execute = "xdotool key alt+Right" },
]

It would be daft to have something like treshold and even acceleration settings for each of the commands.

smileBeda avatar Nov 30 '23 02:11 smileBeda

Hey, I'm sorry; I never saw this or else it completely slipped my attention. I just pushed an update that changes the minimum distance for it to be considered a swipe (also discussed in #12) -- does this help?

mqudsi avatar May 06 '24 21:05 mqudsi

For the same reasons as OP, I'm building manually as a workaround to no configurable settings. I'm on a Lenovo thinkpad X1 and 300 is too sensitive. Swipe fwd+back when using the browser is triggered accidentally all the time. 1000 works better but is still not perfect, so I'm going to try higher.

+1 for a larger swipe left/right threshold by default and configurable swipe distance. Especially if touchpads from various manufactures behave differently.

For example:

gestures = [
    # Navigate next
    { type = "swipe", direction = "right", min_distance = "1000", fingers = 2, execute = "xdotool key alt+Right" },
    # Navigate previous
    { type = "swipe", direction = "left", min_distance = "1000", fingers = 2, execute = "xdotool key alt+Left" },
]

rizumu avatar Jun 27 '24 02:06 rizumu

The kernel documentation implies it's supposed to be an absolute value implying (and leading me to believe) I just needed to find something that worked for me and use it everywhere but it doesn't seem that's the case. If so, I guess I need to surface a variable for this, but it would probably make more sense to make it per-device rather than per-gesture?

I suppose it could be set at the device level and overridden per-gesture as well, if that complexity is warranted.

mqudsi avatar Jun 27 '24 05:06 mqudsi

I realized my PKGBUILD wasn't building with the local edits to events.rs in my clone because I didn't commit the change. I checked again today and 500 seems to be the sweet spot on my device.

I'm glad to have learned about patching an aur package and how to get the PKGBUILD to point at a local clone with the patch, but I probably should have set up a proper Rust development environment so I could of tested the binary more easily.

So definitely a setting would be nice to quickly configure devices. An x/y threshold globally per device would work as well.

rizumu avatar Jul 06 '24 22:07 rizumu