🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    M5 tough remove touch buttons

    Scheduled Pinned Locked Moved Lessons and Guides
    7 Posts 4 Posters 11.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      HansDia95
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • felmueF Offline
        felmue
        last edited by felmue

        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 hide block?

        Care to share your UIFlow code?

        Thanks
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        1 Reply Last reply Reply Quote 0
        • H Offline
          HansDia95
          last edited by

          Hi again I'm using Arduino IDE btw :)

          Thanks again :)

          1 Reply Last reply Reply Quote 0
          • felmueF Offline
            felmue
            last edited by

            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

            GPIO translation table M5Stack / M5Core2
            Information about various M5Stack products.
            Code examples

            1 Reply Last reply Reply Quote 0
            • S Offline
              SkyNorth
              last edited by

              Look in

              https://github.com/m5stack/M5Tough/blob/master/src/utility/M5Button.h

              It explains the touch button usage.
              -Brent

              H 1 Reply Last reply Reply Quote 0
              • H Offline
                HansDia95 @SkyNorth
                last edited by

                @skynorth Thanks A lot!!

                it was button.hide(), but I had to fill the screen after.

                Thanks!!! :)

                C 1 Reply Last reply Reply Quote 0
                • C Offline
                  CharlieTango @HansDia95
                  last edited by

                  @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)

                  1 Reply Last reply Reply Quote 0

                  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
                  • First post
                    Last post