Skip to content

Conversation

@melsem
Copy link

@melsem melsem commented Feb 28, 2021

#wertarbyte/triggerhappy#31
Developer: ** @trurle**

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 checked encoder, works!
Thank trurle!

/dev/input/event3 - my rotary encoders

sem@RV508:~$ 
sem@RV508:~$ ssh root@192.168.0.134
root@192.168.0.134's password: 


BusyBox v1.30.1 () built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 19.07.6, r11278-8055e38794
 -----------------------------------------------------
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 added 3 commits February 28, 2021 13:49
wertarbyte/triggerhappy#31
Developer: https://github.com/trurle

Signed-off-by: Semen Kreyda <aswerklon@gmail.com>
Signed-off-by: melsem <skreyda@rambler.ru>
Signed-off-by: Semen Kreyda <aswerklon@gmail.com>
Signed-off-by: melsem <skreyda@rambler.ru>
add-rotary_encoder.patch - >> 001-add_REL-ABS-devices.patch

Signed-off-by: Semen Kreyda <aswerklon@gmail.com>
Signed-off-by: melsem <skreyda@rambler.ru>
@feckert
Copy link
Member

feckert commented Jun 22, 2021

Please fixup and rebase your commit to one commit.

@melsem
Copy link
Author

melsem commented Jul 5, 2021

I don’t know how to do it right?

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