Skip to content
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

getType() with Long Click Detected #41

Closed
ryancasler opened this issue Sep 24, 2022 · 1 comment
Closed

getType() with Long Click Detected #41

ryancasler opened this issue Sep 24, 2022 · 1 comment
Labels

Comments

@ryancasler
Copy link
Contributor

ryancasler commented Sep 24, 2022

The press type of that is stored for the button is not updated until the button is released isn't it? I ran into a bit of a problem trying to use a multi-type handler with longClickDetected. It would always report the previous click type until I did 2 in a row. But the same setup worked perfectly if I had a separate handler. That's when it occurred to me that the press type might not be updated until the button is released, therefore causing my problem. Might be something to mention as another difference between longClickHandler and longClickDetectedHanlder.
But I love the new custom handler function! I am planning on using a Seesaw GPIO expander from Adafruit for a project and the only thing that has been holding me back is needing to code all of the button handler timing manually. This is wonderful! Thank you!

@LennartHennigs
Copy link
Owner

Hey @ryancasler,

thanks for the feedback.

That's when it occurred to me that the press type might not be updated until the button is released, therefore causing my problem. Might be something to mention as another difference between longClickHandler and longClickDetectedHandler.

And yes, that is the case.
Good point though, I will mention it in the example. Thank you.

But I love the new custom handler function!
Glad you like it. Was an idea from the community. Wouldn't have thought of it myself.
But used it shortly afterwards for the M5 Stack. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants