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

🚀One Button for Next Song and Skip Forward #1666

Closed
Nacktmull87 opened this issue Dec 7, 2021 · 4 comments · Fixed by #2367
Closed

🚀One Button for Next Song and Skip Forward #1666

Nacktmull87 opened this issue Dec 7, 2021 · 4 comments · Fixed by #2367

Comments

@Nacktmull87
Copy link

Hi everyone,

is it possible to give one Button two functions of Play Next Song when Pushed The Button for a short Time and skip Forward when its hold for a View Seconds?

I tried IT, but when i hold The Button its jumping to the Next Song and then IT Starts to skip in the song. Is there Any Chance that this will not Happen?

I Hope you will understand what i mean.

Thx for your help.

Sry for my Bad english

@TheDuffman85
Copy link

Only thing that worked for me is to reverse the order. Forward seek on short push and next title on long push. If you long push the button first it will perform a forward seek and then skip to the next title.

@AlvinSchiller
Copy link
Collaborator

AlvinSchiller commented Feb 27, 2024

Hi,
here is a change to the button implementation to change this behavior (currently only considered as a hack).
With this only one of the functions should be called and not both.
For "hold_mode=SecondFunc" and "hold_mode=SecondFuncRepeat" this means:

  • if the button is pressed shorter than the "hold_time" the main Function is executed.
  • if the button is pressed longer than the "hold_time" the second Function is executed.

To apply replace the function longPressHandler in components/gpio_control/GPIODevices/simple_button.py with this.

@AlvinSchiller
Copy link
Collaborator

AlvinSchiller commented May 5, 2024

referenced discussions:

#1827
#1864
#1999
#2247
#2365

@AlvinSchiller
Copy link
Collaborator

AlvinSchiller commented May 8, 2024

This is now fixed with ##2367 for v2.8.0.
The behavior of hold_mode SecondFunc and SecondFuncRepeat has changed. The secondary function is no longer triggered additionally to the primary function.
Now its called exclusively if hold_time is reached. The primary function will only be triggered if the button is pressed shorter then hold_time! Existing configurations may need to adapt to this.

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

Successfully merging a pull request may close this issue.

4 participants