🤖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

    Lessons and Guides
    4
    7
    8.4k
    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
      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
        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
          HansDia95
          last edited by

          Hi again I'm using Arduino IDE btw :)

          Thanks again :)

          1 Reply Last reply Reply Quote 0
          • felmueF
            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
              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
                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
                  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
                  • First post
                    Last post