Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GestureAction: Add scroll support #384

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

S-trace
Copy link

@S-trace S-trace commented May 25, 2023

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

@roshal
Copy link

roshal commented Jul 21, 2023

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")
						}
					},
				)
			}
		},
	)

})

@S-trace
Copy link
Author

S-trace commented Jul 22, 2023

@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?

@roshal
Copy link

roshal commented Jul 22, 2023

not patched version

image

no such directions as expected

@roshal
Copy link

roshal commented Jul 22, 2023

patched version has no crashes

image

but actions are not working

@roshal roshal mentioned this pull request Jul 22, 2023
@roshal
Copy link

roshal commented Jul 23, 2023

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
Copy link

roshal commented Jul 23, 2023

thanks for #161

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants