Open ullix opened 3 years ago
Hi @ullix
Nowadays this library doesn't support multiple onPressedFor() events, that is the reason why it only calls the onPressedFor5000
function
Soon we will decide what to do about this and will let you know
I am observing the same behavior. All I want is to have at least 3 different actions on a single button. I can get 2 working fine (single press and long press) but can't add a double press sequence. Any progress on this issue?
I solved this for me by moving to the AceButton lib. I use now clicked, double clicked, and long pressed functions, and I can detect a button press during boot. Works well for me.
Thanks for your reply @ullix. I'll check out the AceButton lib. Although I was able to modify the EasyButton library to make it work by using esp8266 Ticker library to generate a one time callback after the maximum time duration has lapsed to only trigger the action associated with the maximum clicks but I'm not sure if this lib is supported by other boards so I'll probably stick with something tested across multiple boards.
I am surprised by the results I am getting when defining multiple duration and sequence calls. Is this really the intended behavior of this lib?
This is the preogram, modified from your example:
The result is the following:
Pressing the button for 10 sec. After 5sec this is printed:
I'd expect the print would occur only after 10 sec, but so far ok. Now I press the button for 3 sec:
I'd expect the callback for duration 2000 to fire, but this actually never shows up.
Now I am pushing the button 4 times within 1 sec. This is the result:
So, I am getting 4 single button presses, 2 double presses, 1 triple press and 1 quattro press, while all I was wanting was 1 quattro press.
Effectively I have only two options: one single press, plus one long press. Everything else cannot be distinguished. Am I doing something wrong, or is that really intended?