-
Notifications
You must be signed in to change notification settings - Fork 5.2k
rotary encoder overlay - add push button? #2312
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
Comments
What effect would you want pushing the button to have - a key press? You can see an example of hooking a GPIO up to emulate a key in the gpio-shutdown overlay. |
The specific thought I had in mind was the navigation of menus and changing of volume in audio and media center setups. But I guess this is context dependent, so perhaps isn't that useful for this generic overlay but should require a EDIT: edited for auto-correct faliure |
A generic If you want some examples, the gpio-key module is used by the gpio-shutdown and tinylcd35 overlays. |
so you mean something like the gpio-shutdown one, but with parameters / overrides to choose other functions / key assignments from the gpio-keys bindings? Might actually add this for easy config of buttons on our PaPiRus / Media Center HAT and other boards. Seems like a nice little way to do it :-) |
Yes, in use it would look something like |
@pelwell for the media-center HAT overlay, I am thinking to use a similar method to set up the joystick / buttons automatically to keys. Is there a way to do this same method for multiple keys? Do you have an example overlay that does this for multiple keys? |
Although I haven't tested it, I think we should be able to use the magic Basically, the created node would have to look something like this:
Modifying the |
@pelwell sorry if any of the following questions seem a bit stupid, but i am a little bit out of my depth at this point! With the method you have said above - how would that then work to assign multiple keys to a board? is it some parameters after the dtoverlay call in config? For reference, our board uses GPIO 13, 17, 22, 26, 27 (corresponding to Up SW1, left SW2, right SW4, down SW3, enter SW5 in image below) The joystick uses the same pin mapping as the switches (it is just a 5 way switch) |
P.S. i realise this is a bit off topic in regards to the rotary encoder, but talking about the same button mapping technique. Would it be better if I moved this to a new issue? |
To map your switches to the first 5 function keys you would say:
|
You can leave the discussion here or create a Pull Request as soon as you have any kind of work-in-progress. |
aha - i see what you mean. so make an overlay called gpio-key-overlay.dts ? |
Yes, that's the idea. By the way, the label appears to be used by the GPIO framework to indicate the "owner" of the pin - it is information for users rather than something which has to be correct in order for the key to work. |
ok, made an attempt here #2329 |
Closing this issue as gpio mappable button is now sorted in gpio-key-overlay.dts so can use this to set a button for a rotary encoder |
There is a rotary encoder overlay:
It would be nice to add a push button input to this for rotary encoders with a built in push button. Would this be feasible?
The text was updated successfully, but these errors were encountered: