Skip to content

Commit 963a629

Browse files
author
melsem
committed
Triggerhappy 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 wertarbyte/triggerhappy#31 Signed-off-by: melsem <[email protected]>
1 parent 270e8ea commit 963a629

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Date: 28 Feb 2018 18:29:50 +0100
2+
Subject: [PATCH] added support for pure REL/ABS devices (such as rotary encoders)
3+
4+
Some input devices such as rotary encoders don't have keys or switches,
5+
but can generate EV_REL/EV_ABS events.
6+
This simple change allows these devices to be used with triggerhappy.
7+
8+
Developer: https://github.com/trurle
9+
10+
Signed-off-by: Semen Kreyda <[email protected]>
11+
---
12+
devices.c | 3 ++-
13+
1 file changed, 2 insertions(+), 1 deletions(-)
14+
15+
--- a/devices.c
16+
+++ b/devices.c
17+
@@ -45,7 +45,8 @@
18+
int rc = ioctl(fd, EVIOCGBIT(0,sizeof(bits)), bits);
19+
return rc > 0 && (
20+
/* we only consider devices with keys or switches suitable */
21+
- test_bit(EV_KEY, bits) || test_bit(EV_SW, bits)
22+
+ test_bit(EV_KEY, bits) || test_bit(EV_SW, bits) ||
23+
+ test_bit(EV_REL, bits) || test_bit(EV_ABS, bits)
24+
);
25+
}
26+

0 commit comments

Comments
 (0)