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

Setting the attachDuringLongPress event interval #88

Closed
FransCouwberghs opened this issue Apr 16, 2021 · 4 comments
Closed

Setting the attachDuringLongPress event interval #88

FransCouwberghs opened this issue Apr 16, 2021 · 4 comments

Comments

@FransCouwberghs
Copy link

Is it possible to set the interval for the attachDuringLongPress event?
I use two buttons to increase or decrease a number on a display.
I use the same function for attachClick and attachDuringLongPress so one can increase/decrease with one digit or 'speed' true the setting by holding down the button.
The 'speed' however is way to fast.
What I do now is testing at the end of the function whether the button is in a isLongPressed()) state and delay a period:

if (btnIncrease.isLongPressed()){
delay(50);}

This works quite well, but I have a aversion for delay().
I was thinking of a function setLongPressInterval(int) (likewise setPressTicks(int)) to set the interval.

Keep up the good work!

@Zaighum1
Copy link

Zaighum1 commented Dec 5, 2022

have you find it??? if yes then kindly guide me if i can set the interval and duration of attachDuringLongPress event ??

@IhorNehrutsa
Copy link
Contributor

@IhorNehrutsa
Copy link
Contributor

#124
Add setLongPressIntervalMs(ms)
Set interval in msecs between calls of the DuringLongPress event.

@mathertel
Copy link
Owner

fixed by #124

mathertel added a commit that referenced this issue Jun 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants