Skip to content

Commit

Permalink
Fix dependency of TapDance on instantiated HoldTap (#1027)
Browse files Browse the repository at this point in the history
  • Loading branch information
xs5871 authored Sep 3, 2024
1 parent 57f3ea2 commit deb36a3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kmk/modules/tapdance.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from kmk.keys import KC, Key, make_argumented_key
from kmk.keys import Key, make_argumented_key
from kmk.modules.holdtap import ActivationType, HoldTap, HoldTapKey


Expand All @@ -15,7 +15,7 @@ def __init__(self, *keys, tap_time=None, **kwargs):

for key in keys:
if not isinstance(key, HoldTapKey):
ht_key = KC.HT(
ht_key = HoldTapKey(
tap=key,
hold=key,
prefer_hold=True,
Expand Down
11 changes: 11 additions & 0 deletions tests/test_tapdance.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@
from tests.keyboard_test import KeyboardTest


class TestTapDanceNoHT(unittest.TestCase):
def test(self):
KC.clear()

self.keyboard = KeyboardTest(
[TapDance()],
[[KC.TD(KC.N0, KC.N1)]],
debug_enabled=False,
)


class TestTapDance(unittest.TestCase):
def setUp(self):
self.t_within = 2 * KeyboardTest.loop_delay_ms
Expand Down

0 comments on commit deb36a3

Please sign in to comment.