Header and Buttons Only

  • Greetings,

    First and foremost, thank you Rop for writing this library, saved me a ton of time.

    I'm currently working on a M5Stack Gray application and want only the header, and a couple buttons; I'll add task code (yield) or interrupts later. I first want to get the UI working.

    I have no issues getting the header to display as I wish.
    I have no problems getting the buttons to display.

    However, I am not able to read the buttons. Calling the ez.buttons.poll() in my loop does not ever return any key pressed.

    Can you please show me an example of just a header, buttons and a means of retrieving the pressed button.

    Thank you!

  • Hi Bob,

    I don't check this forum that regularly, so you're kind of lucky I see this. It's best to open an issue on the M5ez github.

    As for your question: ez.buttons.poll() should return the key pressed, or an empty string if nothing is pressed, so you are presumably calling it from inside a loop? If you have nothing else to do in that loop and just want the the code to wait for a keypress, use ez.buttons.wait() instead. Let me know if this was not the issue, and in that case maybe show the code.