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

Question: what should wasPressedFor()return for double and triple clicks? #35

Open
LennartHennigs opened this issue Apr 4, 2022 · 4 comments
Assignees
Labels

Comments

@LennartHennigs
Copy link
Owner

Hey,
I noticed that wasPressedFor() always the returns the time for the last click.
This sounds ok but for double and triple clicks it might not be helpful.

What would you expect?

  • the total time (i.e. the sum of the clicks)?
  • the time for single and long press and nothing for double and triple?
  • something else?

Ideas are welcome.

@ryancasler
Copy link
Contributor

I would vote for B. I can't think of a use-case where I would need to know the total amount of time that a button had been clicked for over multiple clicks.

@Alekeep
Copy link

Alekeep commented Jan 14, 2024

Happened upon this question while looking to handle an application need. Thus far, I have only used this button2 for simple pin press input so may have bad assumptions about other usage.
I need to detect multiple clicks beyond the specificly handled single, double, and triple and also to know if the last click is short or long.
First, may I ask, will getNumberOfClicks() return a count higher than 3?
If so in answe to your question, I would want
wasPressedFor() to remain as-is to provide the length of the last click.
Thanks!

@LennartHennigs
Copy link
Owner Author

@Alekeep yes, getNumberOfClicks()returns the true number.

ok, length if the last click.

@LennartHennigs LennartHennigs self-assigned this Mar 26, 2024
@Alekeep
Copy link

Alekeep commented Mar 26, 2024

@LennartHennigs, this seems to be the most useful approach... at least for me.
Thanks!

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

3 participants