ropg / M5Core2

M5Core2 Arduino Library
MIT License
7 stars 1 forks source link

Bug: Button::pressedFor() always true in M5ez ezButtons::poll() #72

Open vkichline opened 4 years ago

vkichline commented 4 years ago

Using M5Sound branch w/ M5ez, ABC buttons w/ short and long presses always execute the long press. This is a pretty recent regression. Specifically, standard menu buttons whose left button is “up#back#...” always executes back when tapped.

vkichline commented 4 years ago

The only solution I could find was to add _lastChange = _time; to both Button::fingerDown() and Button::fingerUp(). For some reason, Button::read() was not called by ezButtons::poll() before m5.BtnB.pressedFor(), although it sure looks like it should be; ez.yield() is called. I found the _lastChanged time in the buttons was always way out of date when pressedFor() is evaluated. This is a puzzle, but try it with M5ez, and any menu w/ short/long buttons.