implement per-key tap_time.

This commit is contained in:
xs5871
2022-01-25 19:52:13 +00:00
committed by Kyle Brown
parent 21c058aaa8
commit f30206c7d5
3 changed files with 11 additions and 5 deletions

View File

@@ -61,8 +61,12 @@ class HoldTap(Module):
def ht_pressed(self, key, keyboard, *args, **kwargs):
'''Do nothing yet, action resolves when key is released, timer expires or other key is pressed.'''
if key.meta.tap_time is None:
tap_time = self.tap_time
else:
tap_time = key.meta.tap_time
timeout_key = keyboard.set_timeout(
self.tap_time,
tap_time,
lambda: self.on_tap_time_expired(key, keyboard, *args, **kwargs),
)
self.key_states[key] = HoldTapKeyState(timeout_key, *args, **kwargs)