You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe:
Hi, thanks a lot for adding 22a20b2, it noticeably reduces latency! I think it may be further reduced so filing this feature request.
Describe the solution you'd like:
Does the plugin really need to wait "Release" event if long and double press are disabled? it seems like "Release" would happen anyways so it seems like waiting it just delays the action.
Describe alternatives you've considered:
I don't see other alternatives.
Additional context:
If this idea sounds reasonable to you, I can submit a pull request with the change. Something like:
index 7bd7ea9..dbd70d5 100644
--- a/src/ButtonState.ts
+++ b/src/ButtonState.ts
@@ -148,12 +148,16 @@ export class ButtonTracker {
case ButtonState.IDLE: {
if (action === 'Press') {
this.state = ButtonState.DOWN;
+ this.log.debug(`btrk ${this.href} now in state DOWN`);
if (this.longPressDisabled) {
- this.log.info(`button ${this.href} long press disabled. suppressing.`);
+ if (this.doublePressDisabled) {
+ this.shortPressCB();
+ } else {
+ this.log.info(`button ${this.href} long press disabled. suppressing.`);
+ }
} else {
this.timer = setTimeout(longPressTimeoutHandler, this.longPressTimeout);
}
- this.log.debug(`btrk ${this.href} now in state DOWN`);
} else {
// no-op
this.log.debug(`btrk ${this.href} no-op IDLE action ${action}`);
Thanks for considering it!
The text was updated successfully, but these errors were encountered:
This! I’m locked on an old version before double and long were implemented because I need responsiveness from something that’s replacing a physical switch.
borovsky-d
changed the title
Single press latency if both doubdouble press and long press are disbled.
Single press latency if both double press and long press are disabled.
Sep 11, 2023
My time is so limited to work on this (or any other OSS project) that I greatly appreciate PRs, and chances are good that if you pinky-swear it works for you, I'll merge it and ship it straight to prod. 😆
@borovsky-d, I just looked at your changes in the -fast version and they look correct. Once you've tested, I'd greatly appreciate (and eagerly merge) a PR. :)
Is your feature request related to a problem? Please describe:
Hi, thanks a lot for adding 22a20b2, it noticeably reduces latency! I think it may be further reduced so filing this feature request.
Describe the solution you'd like:
Does the plugin really need to wait "Release" event if long and double press are disabled? it seems like "Release" would happen anyways so it seems like waiting it just delays the action.
Describe alternatives you've considered:
I don't see other alternatives.
Additional context:
If this idea sounds reasonable to you, I can submit a pull request with the change. Something like:
Thanks for considering it!
The text was updated successfully, but these errors were encountered: