This commit is contained in:
Harley Mellifont 2024-09-01 21:33:12 +08:00 committed by GitHub
commit 5e43f3e193
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -182,9 +182,8 @@ static int on_sticky_key_binding_released(struct zmk_behavior_binding *binding,
sticky_key->release_at = event.timestamp + sticky_key->config->release_after_ms;
// adjust timer in case this behavior was queued by a hold-tap
int32_t ms_left = sticky_key->release_at - k_uptime_get();
if (ms_left > 0) {
k_work_schedule(&sticky_key->release_timer, K_MSEC(ms_left));
}
ms_left = ms_left > 0 ? ms_left : 1;
k_work_schedule(&sticky_key->release_timer, K_MSEC(ms_left));
return ZMK_BEHAVIOR_OPAQUE;
}