updates based on review comments
This commit is contained in:
parent
bce7959f66
commit
1b902b907c
@ -27,17 +27,15 @@ class ModHoldAndTap(Module):
|
||||
def process_key(self, keyboard, key, is_pressed, int_coord):
|
||||
if isinstance(key.meta, ModHoldAndTapValidator):
|
||||
|
||||
layer_id = keyboard.active_layers[0]
|
||||
if layer_id > 0:
|
||||
if self._active and self._prev_key is not None and is_pressed:
|
||||
# release previous key
|
||||
self.release(keyboard, self._prev_key)
|
||||
self._prev_key = key
|
||||
if is_pressed:
|
||||
keyboard.process_key(key.meta.mod, is_pressed)
|
||||
if self._active and self._prev_key is not None and is_pressed:
|
||||
# release previous key
|
||||
self.release(keyboard, self._prev_key)
|
||||
self._prev_key = key
|
||||
if is_pressed:
|
||||
keyboard.process_key(key.meta.mod, is_pressed)
|
||||
|
||||
self._active = True
|
||||
keyboard.process_key(key.meta.kc, is_pressed)
|
||||
self._active = True
|
||||
keyboard.process_key(key.meta.kc, is_pressed)
|
||||
|
||||
elif self._active:
|
||||
# release previous key if any other key is pressed
|
||||
|
@ -46,6 +46,10 @@ class TestModHoldLayerTap(unittest.TestCase):
|
||||
(1, False),
|
||||
],
|
||||
[
|
||||
{KC.LSFT, KC.LCTL, KC.TAB},
|
||||
{KC.LSFT, KC.LCTL},
|
||||
{KC.LSFT, KC.LCTL, KC.TAB},
|
||||
{KC.LSFT, KC.LCTL},
|
||||
{KC.B},
|
||||
{},
|
||||
],
|
||||
@ -97,6 +101,8 @@ class TestModHoldLayerTap(unittest.TestCase):
|
||||
{KC.LGUI},
|
||||
{KC.B},
|
||||
{},
|
||||
{KC.LSFT, KC.LCTL, KC.TAB},
|
||||
{KC.LSFT, KC.LCTL},
|
||||
{KC.B},
|
||||
{},
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user