Hi all,
I'm building an application that shall be controlled with a rotary-encoder that is also a button (so you can push it and rotate it). For development and debugging, using a standard keyboard should also be possible
The button functionality of the rotary encoder is no problem, the dtoverlay "gpio-key" works perfectly there.
However, processing the rotation of the rotary-encoder is a bit more complicated. The dtoverlay "rotary-encoder" will correctly detect the rotation, but it transforms this into scroll events, not keyboard events like "gpio-key".
Using "gpio-key" for the rotation does kind of work, as it does detect the rotation. However, only the "key down" event is fired, leading to "stuck key" behaviour. So if the rotary encoder is turned in one direction, the defined key is virtually "pressed down" but never released.
So, my question is: Is there a way to have "gpio-key"-like behaviour with a rotary encoder? Since there are countless dtoverlays, maybe there's one that does exactly this (or can abused to achieve this).
I've read viewtopic.php?p=2001007&hilit=rotary+key#p2001007 and I do understand how dtoverlays work. If the answer is "no, there isn't a way to do this with dtoverlays", then I'll accept this. But the next question then would be: Is there any other way I can achieve this?![Wink ;)]()
The application is web-based, so the Pi will basically just display a chromium window in kiosk mode. So just reading the GPIOs from the app and detecting events there will be at least a lot of work, if not impossible (haven't read up on that yet, but I would want to avoid that if possible).
Thanks in advance!
I'm building an application that shall be controlled with a rotary-encoder that is also a button (so you can push it and rotate it). For development and debugging, using a standard keyboard should also be possible
The button functionality of the rotary encoder is no problem, the dtoverlay "gpio-key" works perfectly there.
However, processing the rotation of the rotary-encoder is a bit more complicated. The dtoverlay "rotary-encoder" will correctly detect the rotation, but it transforms this into scroll events, not keyboard events like "gpio-key".
Using "gpio-key" for the rotation does kind of work, as it does detect the rotation. However, only the "key down" event is fired, leading to "stuck key" behaviour. So if the rotary encoder is turned in one direction, the defined key is virtually "pressed down" but never released.
So, my question is: Is there a way to have "gpio-key"-like behaviour with a rotary encoder? Since there are countless dtoverlays, maybe there's one that does exactly this (or can abused to achieve this).
I've read viewtopic.php?p=2001007&hilit=rotary+key#p2001007 and I do understand how dtoverlays work. If the answer is "no, there isn't a way to do this with dtoverlays", then I'll accept this. But the next question then would be: Is there any other way I can achieve this?

The application is web-based, so the Pi will basically just display a chromium window in kiosk mode. So just reading the GPIOs from the app and detecting events there will be at least a lot of work, if not impossible (haven't read up on that yet, but I would want to avoid that if possible).
Thanks in advance!
Statistics: Posted by st_jwinter — Fri Feb 23, 2024 10:48 am — Replies 5 — Views 57