Skip to content

Triggerhappy added support for pure REL/ABS devices. #17673

Description

@melsem

Please add a patch for TriggerHappy.

Tried pull-request but don't know how to use github.

Developer: https://github.com/trurle

wertarbyte/triggerhappy#31
Wertarbyte does not answer. Last commit by wertarbyte committed on 6 Sep 2016

/packages/utils/triggerhappy/patches/001-add_REL-ABS-devices.patch

Date: 28 Feb 2021 18:29:50 +0100
Subject: [PATCH] added support for pure REL/ABS devices (such as rotary encoders)

Some input devices such as rotary encoders don't have keys or switches, 
but can generate EV_REL/EV_ABS events.
This simple change allows these devices to be used with triggerhappy.

Developer: https://github.com/trurle

Signed-off-by: Semen Kreyda <aswerklon@gmail.com>
---
 devices.c | 1 +
 1 file changed, 1 insertions(+)

--- a/devices.c
+++ b/devices.c
@@ -45,6 +45,7 @@
 	int rc = ioctl(fd, EVIOCGBIT(0,sizeof(bits)), bits);
 	return rc > 0 && (
 		/* we only consider devices with keys or switches suitable */
+		test_bit(EV_REL, bits) || test_bit(EV_ABS, bits) ||
 		test_bit(EV_KEY, bits) || test_bit(EV_SW, bits)
 	);
 }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions