TcMenu / tcMenu

Menu library for Arduino, mbed and ESP with designer UI and remote control capabilities.
https://www.thecoderscorner.com/products/arduino-libraries/tc-menu/
Apache License 2.0
292 stars 24 forks source link

Add setter to enable encoder intent for hardware encoders. #458

Open davetcc opened 7 months ago

davetcc commented 7 months ago

Discussed in https://github.com/davetcc/tcMenu/discussions/457

Originally posted by **AndyB117** March 13, 2024 I use rotary encoder. And I connect pins so that when I turn rotary clockwise than navigate UP to menu tree, counter-clockwise - DOWN. But when I edit values in menu items turning clockwise decreases the value rather than increasing it! In my opinion this is not logical. People usually associate the concepts UP and INCREASE. DOWN and DECREASE. But not vice versa. How can I make it so that menu navigation UP and INCREASING values are achieved by turning to one side?
davetcc commented 7 months ago

This is a very simple addition to enable the intent that already is used by the up/down encoder.

davetcc commented 7 months ago

For example, once this code is committed calling switches.getEncoder(0)->setHonourIntent(true); will make the encoder change direction to allow for situations where there is a different direction between navigating and editing.

davetcc commented 3 months ago

This is actually a little more complex than initially thought and should be rounded up with other planned rotary encoder changes