logiops icon indicating copy to clipboard operation
logiops copied to clipboard

GestureAction: Add scroll support

Open S-trace opened this issue 1 year ago • 6 comments

Allow users to use vertical scroll wheel rotation in gestures (for zooming in/out, volume control and so on).

The original code belongs to abraha2d (https://github.com/abraha2d/logiops/tree/scroll-support), I just have ported it to logiops v0.3.2

S-trace avatar May 25 '23 15:05 S-trace

config suggestion for testing

devices = ({

	name = "Wireless Mouse MX Master 3"

	dpi = 1600

	buttons = (
		{
			### Gesture Button
			cid = 0xC3
			action = {
				type = "Gestures"
				gestures = (
					{
						direction = "ScrollUp"
						mode = "OnRelease"
						threshold = 1
						action = {
							type = "Keypress"
							keys = ("KEY_LEFT")
						}
					},
					{
						direction = "ScrollDown"
						mode = "OnRelease"
						threshold = 1
						action = {
							type = "Keypress"
							keys = ("KEY_RIGHT")
						}
					},
				)
			}
		},
	)

})

roshal avatar Jul 21 '23 14:07 roshal

@roshal Logid crashes with your config on my Logitech Mx Master 3 mouse:

    /etc  logid                                                                                                           INT ✘  root@tuf 
[INFO] Device found: Wireless Mouse MX Master 3 on /dev/hidraw1:255
zsh: segmentation fault (core dumped)  logid

Which logid's version have you used to test this config file? Is this a patched version (with pull request) or not patched version (upstream) build?

S-trace avatar Jul 22 '23 00:07 S-trace

not patched version

image

no such directions as expected

roshal avatar Jul 22 '23 23:07 roshal

patched version has no crashes

image

but actions are not working

roshal avatar Jul 22 '23 23:07 roshal

actions work when hiresscroll target is true

devices = ({

	name = "Wireless Mouse MX Master 3"

	dpi = 1600

	hiresscroll = {
		hires = false
		### invert = false
		target = true
		up = {
			mode = "Axis"
			axis = "REL_WHEEL"
			axis_multiplier = +1.0
		}
		down = {
			mode = "Axis"
			axis = "REL_WHEEL"
			axis_multiplier = -1.0
		}
	}

	buttons = (
		{
			### Gesture Button
			cid = 0xC3
			action = {
				type = "Gestures"
				gestures = (
					{
						direction = "ScrollUp"
						mode = "OnRelease"
						threshold = 1
						action = {
							type = "Keypress"
							keys = ("KEY_LEFT")
						}
					},
					{
						direction = "ScrollDown"
						mode = "OnRelease"
						threshold = 1
						action = {
							type = "Keypress"
							keys = ("KEY_RIGHT")
						}
					},
				)
			}
		},
	)

})

roshal avatar Jul 23 '23 00:07 roshal

thanks for #161

roshal avatar Jul 23 '23 00:07 roshal