fix tapdance crash and add unit-tests

This commit is contained in:
xs5871
2022-06-18 13:23:32 +00:00
committed by Kyle Brown
parent b25f325871
commit e829bc83de
2 changed files with 220 additions and 1 deletions

View File

@@ -76,7 +76,10 @@ class TapDance(HoldTap):
self.key_states[current_key].tap_dance = key
def td_released(self, key, keyboard, *args, **kwargs):
kc = key.meta.keys[self.td_counts[key]]
try:
kc = key.meta.keys[self.td_counts[key]]
except KeyError:
return
state = self.key_states[kc]
if state.activated == ActivationType.HOLD_TIMEOUT:
# release hold