leshow / rotary-encoder-hal

A simple platform agnostic rotary encoder library
MIT License
28 stars 15 forks source link

Support button click #2

Open dereulenspiegel opened 4 years ago

dereulenspiegel commented 4 years ago

It would be really cool if this library would support "clickable" rotary encoders. The corresponding arduino library (like https://github.com/0xPIT/encoder/tree/arduino) supports detection of Click, DoubleClick, Held and Release. If this is in the scope of this project, this would probably help a little bit in the transition from arduino to rust projects.

leshow commented 4 years ago

Sure! I don't see why we couldn't support something like that. It might help to put it behind a feature gate.

ahmedcharles commented 1 year ago

Note, clickable encoders use different pins to detect clicks than the ones used by the encoder, so I'm not sure there's much benefit to joining them. Also, there are encoders that have 5 switches (https://www.adafruit.com/product/5001) which would suggest having to support an arbitrary number of switches.