spacehuhn / SimpleButton

A simple Arduino library to make interfacing and reacting on buttons or other inputs easier.
MIT License
67 stars 21 forks source link

events clicked and holding do interfere #4

Open cyberman54 opened 5 years ago

cyberman54 commented 5 years ago

If i use events clicked and holding on the same button, they interfere: when holding the button, this generates the holding event, but also an unsolicited clicked event.

homonto commented 1 year ago

I had the same, also doubleclick I solved by manipulating the timers but it was not really elegant solution I ended up using: b->setOnClicked(&OnClicked_cb,100,100); and by reading the time button is clicked: uint32_t pushed_ms = b->getPushTime(); I simulate holding function

cyberman54 commented 1 year ago

Meanwhile i changed to OneButton lib.