-
-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple onPressedFor #60
Comments
I am trying to do the same thing, and having the same problems. |
Hi @FraOre and @TylerTotally, I will take a look at this. |
Basically, it is the last defined OnPressedFor that is stamped in the EasyButtonBase class's members. WIhich is to say that all the previous calls to OnPressedFor are overwritten by the last one. So in the initial message, the 3000 callback it the winning one, but if they were declared 3000 THEN 1000, only the 1000 one will be used (and triggered) So I believe that an array (or a chained list of events) should be set in place in order to hold the different OnPressedFor callbacks. |
This would be a useful addition to the library |
Hi,
I would like to do something like this with the same button:
button.onPressedFor(1000, showIP); button.onPressedFor(3000, restartDevice);
so execute two different callback based on the pressing duration. It doesn't work for me. Just the last function is called.
Any idea?
Thank you so much,
Francesco
The text was updated successfully, but these errors were encountered: