triggerhappy
triggerhappy copied to clipboard
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. I checked with my two rotary encoders and it works. thanks!
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:~#