TapDance: Do not mask interrupting keys anymore

We introduced the masking to avoid sending extra keys when the mapped key
changes prior to release - but since the introduction of the caching mechanism,
we no longer need to do this.

However, for the caching to work the way we want it to, we need to map the key
to `NoKey` once, upon interrupting.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>

squash! TapDance: Do not mask interrupting keys anymore

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
pull/886/head
Gergely Nagy 4 years ago
parent c3dd2bd802
commit c797a95fb2
No known key found for this signature in database
GPG Key ID: AC1E90BAC433F68F

@ -38,7 +38,6 @@ void TapDance::interrupt(KeyAddr key_addr) {
last_tap_dance_key_ = Key_NoKey;
Runtime.device().maskKey(key_addr);
Runtime.hid().keyboard().sendReport();
Runtime.hid().keyboard().releaseAllKeys();
@ -114,13 +113,11 @@ EventHandlerResult TapDance::onKeyswitchEvent(Key &mapped_key, KeyAddr key_addr,
if (last_tap_dance_key_ == Key_NoKey)
return EventHandlerResult::OK;
if (keyToggledOn(keyState))
if (keyToggledOn(keyState)) {
interrupt(key_addr);
if (Runtime.device().isKeyMasked(key_addr)) {
Runtime.device().unMaskKey(key_addr);
return EventHandlerResult::EVENT_CONSUMED;
mapped_key = Key_NoKey;
}
return EventHandlerResult::OK;
}

Loading…
Cancel
Save