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

Use ShortPress and LongPress to distinguish between actions #1

Open
PixelAlarm opened this issue Feb 16, 2025 · 5 comments
Open

Use ShortPress and LongPress to distinguish between actions #1

PixelAlarm opened this issue Feb 16, 2025 · 5 comments
Labels
enhancement New feature or request

Comments

@PixelAlarm
Copy link

Is your feature request related to a problem? Please describe.
I created my first Buzzer just now with the use of a "Seeed Studio ESP32S3" and some mechanical keyboard keys.
It was pretty easy with small adjustments to the platform.ini and changing the GPIO number.

Awesome!

I don't see a configuration to be able to trigger different actions with only one letter though.
For direct GPIO Input on a Pi, there are the options for short and long press.

Describe the solution you'd like
It would be really cool to be able to configure two letters on the buzzer. One for short press, one for long press.
A small research showed, that "Button2" could be able to handle short and long press. I'm not able to make the needed additions in the code though.

Describe alternatives you've considered
Would also be possible to utilize two GPIOs and add a second key.
It would need two Buttons next to each other though.

Additional context
Again, nice work!

@mgineer85 mgineer85 added the enhancement New feature or request label Feb 16, 2025
@mgineer85
Copy link
Collaborator

I don't see why you would need 1 letter for 2 actions.

In the buzzer you could have

  • 1 button, short press - letter A, long press - letter B
  • 2 buttons, press button 1 - letter A, press button 2 - letter B

I think you just need to distinguish between short/long press of the button and emit different characters?

@PixelAlarm
Copy link
Author

Yes, I also tried to make it work with Pi GPIO and one button only, but I think this is not possible right now.

So the feature to send different characters from the bluetooth buzzer with only 1 button would be really helpful.

@mgineer85
Copy link
Collaborator

yes, every GPIO can be bound only 1 time. It could be added though ^^

@mgineer85
Copy link
Collaborator

Regarding the buzzer I think it is just a few lines code, maybe in handleTap function only.

@PixelAlarm
Copy link
Author

I made it work with use of a chatbot.

My implementation now emits an „i“ for short press when the button is released and a „c“ while holding for 1.5 seconds (even if not released yet).

Can post my code later.

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

No branches or pull requests

2 participants