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

added support for pure REL/ABS devices (such as rotary encoders) #31

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

Conversation

trurle
Copy link

@trurle trurle commented Feb 21, 2021

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. I checked with my two rotary encoders and it works. thanks!

@melsem
Copy link

melsem commented Feb 28, 2021

I join.
Make changes.
Hurrah..
I checked encoder, works!
Thank trurle!

/dev/input/event3 - rotary encoders

root@orangepi-zero:~# evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:	gpio-keys-user
/dev/input/event1:	rotary_button
/dev/input/event2:	sunxi-ir
/dev/input/event3:	rotary_axis
/dev/input/event4:	HID 0513:0318
/dev/input/event5:	HID 0513:0318
Select the device event number [0-5]: 3
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x0 product 0x0 version 0x0
Input device name: "rotary_axis"
Supported events:
  Event type 0 (EV_SYN)
  Event type 2 (EV_REL)
    Event code 1 (REL_Y)
Properties:
Testing ... (interrupt to exit)
Event: time 1614505570.405308, type 2 (EV_REL), code 1 (REL_Y), value 1
Event: time 1614505570.405308, -------------- SYN_REPORT ------------
Event: time 1614505571.370003, type 2 (EV_REL), code 1 (REL_Y), value 1
Event: time 1614505571.370003, -------------- SYN_REPORT ------------
Event: time 1614505572.359239, type 2 (EV_REL), code 1 (REL_Y), value -1
Event: time 1614505572.359239, -------------- SYN_REPORT ------------
Event: time 1614505573.284278, type 2 (EV_REL), code 1 (REL_Y), value -1
Event: time 1614505573.284278, -------------- SYN_REPORT ------------
root@orangepi-zero:~#
root@orangepi-zero:~#
root@orangepi-zero:~# thd --dump /dev/input/event*
EV_REL	REL_Y	-1	/dev/input/event3
# REL_Y	-1	command
EV_REL	REL_Y	-1	/dev/input/event3
# REL_Y	-1	command
EV_REL	REL_Y	1	/dev/input/event3
# REL_Y	1	command
EV_REL	REL_Y	1	/dev/input/event3
# REL_Y	1	command
root@orangepi-zero:~#

melsem pushed a commit to melsem/packages that referenced this pull request Jan 21, 2022
(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]>
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.

2 participants