M5 tough remove touch buttons
-
Hello
I have tried everything when it comes to removing/hiding/deactivating a button on the touch screen on an M5 tough, searching Google in and out. When I use .fillScreen(), it fills the screen but I can still "click" the button when I touch the screen where it was and then it appears again.
Hoping for an answer to this small question.Thanks a lot! :D
-
Hello @HansDia95
using UIFlow firmware 1.9.8 on my M5Tough I can simply hide a button and after that it no longer is touchable until I make it show again.
Have you tried
Set touch_button_X hideblock?Care to share your UIFlow code?
Thanks
Felix -
Hi again I'm using Arduino IDE btw :)
Thanks again :)
-
Hello @HansDia95
I assumed you are using UIFlow since you've posted under SOFTWARE / UIFlow ...
Anyways, with Arduino there seems to be an issue with hiding (static) buttons. However when I use dynamic buttons it seems to work. Here is a function creating / showing or hiding / deleting a button.
Button *b3 = nullptr; void showHideButton3(bool show) { if(show == true) { if(b3 != nullptr) return; Serial.println("*** show"); b3 = new Button(220, 200, 80, 40, false, "C", off_clrs, on_clrs, MC_DATUM); b3->addHandler(eventDisplay, E_ALL); } else { if(b3 == nullptr) return; Serial.println("*** hide"); b3->delHandlers(); b3->hide(BLACK); delete(b3); b3 = nullptr; } }BTW: I was using above in the context of the M5Tough Touch example.
Thanks
Felix -
Look in
https://github.com/m5stack/M5Tough/blob/master/src/utility/M5Button.h
It explains the touch button usage.
-Brent -
-
@hansdia95 I am running into problems with using button.hide() Can you please provide an example of your usecase? Perhaps I just have a syntax error. I can not find much informaiton on this other than the writeup on github (that provides little informaiotn on this)
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login