[Logo] TCC discussion forum
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Top Downloads] Top Downloads   [Groups] Back to home page 
[Register] Register /  [Login] Login 


This forum is read only and new users cannot register, please ask all new questions either using GitHub discussions, or in Arduino forum tagging @davetcc.

clicked value during renderer.takeOverDisplay RSS feed
Forum Index » tcMenu Arduinio library
Author Message
beve


Joined: Oct 16, 2021
Messages: 1
Offline
Hello,

Thank you for the work on this awesome lib.

I have a question about the "clicked" param passed to the callback of rendered.takeOverDisplay.
It seems that if the button is clicked, the value is set to RPRESS_PRESSED even if the button has been released. If the rotary encoder is rotated, the value is set back to RPRESS_NONE.

After some search i'm able to test if the button is clicked anytime with:

if ((clicked == RPRESS_NONE || clicked == RPRESS_PRESSED) && switches.isSwitchPressed(BUTTON_PIN)) {
  ...
} else if (clicked == RPRESS_HELD) {
  renderer.giveBackDisplay();
}


Am I doing things right ?
davetcc


Joined: Jan 19, 2019
Messages: 686
Offline
This sounds like a bug, most people use the button click to exit the display take over, so I guess this has never been tried.

Please raise a bug in tcMenuLib for this. https://github.com/davetcc/tcMenuLib/issues

There are three possible values

RPRESS_NONE - the button is not pressed
RPRESS_PRESSED - the button is pressed
RPRESS_HELD - the button is held down.
 
Forum Index » tcMenu Arduinio library
Go to:   
Mobile view
Powered by JForum 2.7.0 © 2020 JForum Team • Maintained by Andowson Chang and Ulf Dittmer

This site uses cookies to analyse traffic, serve ads by Google AdSense (non-personalized in EEA/UK), and to record consent. We also embed Twitter, Youtube and Disqus content on some pages, these companies have their own privacy policies.

Our privacy policy applies to all pages on our site

Should you need further guidance on how to proceed: External link for information about cookie management.