TT toggles layer state on key hold

This commit is contained in:
Christian Tu 2021-09-25 10:54:45 +02:00
parent 4e938ef6b6
commit 209acc94b2

View File

@ -127,10 +127,18 @@ class Layers(HoldTap):
keyboard.active_layers.insert(0, key.meta.layer)
def ht_activate_hold(self, key, keyboard, *args, **kwargs):
self._mo_pressed(key, keyboard, *args, **kwargs)
key_type = kwargs['key_type']
if key_type == LayerType.LT:
self._mo_released(key, keyboard, *args, **kwargs)
elif key_type == LayerType.TT:
self._tg_pressed(key, keyboard, *args, **kwargs)
def ht_deactivate_hold(self, key, keyboard, *args, **kwargs):
self._mo_released(key, keyboard, *args, **kwargs)
key_type = kwargs['key_type']
if key_type == LayerType.LT:
self._mo_released(key, keyboard, *args, **kwargs)
elif key_type == LayerType.TT:
self._tg_pressed(key, keyboard, *args, **kwargs)
def ht_activate_tap(self, key, keyboard, *args, **kwargs):
key_type = kwargs['key_type']