updates based on review comments

This commit is contained in:
Syed Hussaini 2022-04-25 08:51:26 -05:00 committed by xs5871
parent bce7959f66
commit 1b902b907c
2 changed files with 14 additions and 10 deletions

View File

@ -27,8 +27,6 @@ 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)

View File

@ -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},
{},
],