diff options
author | Okke Formsma <okke@formsma.nl> | 2021-03-07 14:50:30 +0100 |
---|---|---|
committer | Pete Johanson <peter@peterjohanson.com> | 2021-06-13 10:44:18 -0400 |
commit | efa497c69b813852d3704dbd96207f1186eb941a (patch) | |
tree | 5547b9ad3418998bfff514583a9da5c4d97d7250 /app/src/behaviors/behavior_hold_tap.c | |
parent | 0f281304938dd1820cfe71dee431770ae545c883 (diff) |
fix(behaviors): Fix timing of delayed hold-tap trigger
A hold-tap timer event would be triggered too soon if the hold-tap
was delayed for longer than its tapping-term. This may cause
accidental hold behavior when the correct behavior would be tap.
By queuing the timer event instead of executing it immediately,
other delayed events get a chance to be processed properly.
Diffstat (limited to 'app/src/behaviors/behavior_hold_tap.c')
-rw-r--r-- | app/src/behaviors/behavior_hold_tap.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/app/src/behaviors/behavior_hold_tap.c b/app/src/behaviors/behavior_hold_tap.c index c83305d..0b6b587 100644 --- a/app/src/behaviors/behavior_hold_tap.c +++ b/app/src/behaviors/behavior_hold_tap.c @@ -449,11 +449,7 @@ static int on_hold_tap_binding_pressed(struct zmk_behavior_binding *binding, // if this behavior was queued we have to adjust the timer to only // wait for the remaining time. int32_t tapping_term_ms_left = (hold_tap->timestamp + cfg->tapping_term_ms) - k_uptime_get(); - if (tapping_term_ms_left > 0) { - k_delayed_work_submit(&hold_tap->work, K_MSEC(tapping_term_ms_left)); - } else { - decide_hold_tap(hold_tap, HT_TIMER_EVENT); - } + k_delayed_work_submit(&hold_tap->work, K_MSEC(tapping_term_ms_left)); return ZMK_BEHAVIOR_OPAQUE; } |