Skip to content

Commit

Permalink
Improve key generation debug
Browse files Browse the repository at this point in the history
  • Loading branch information
xs5871 committed Jun 20, 2024
1 parent d50c209 commit 0e1022c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
5 changes: 1 addition & 4 deletions kmk/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,12 +434,9 @@ def __getitem__(self, name: str):

if not maybe_key:
if debug.enabled:
debug(f'Invalid key: {name}')
debug('Invalid key: ', name)
return KC.NO

if debug.enabled:
debug(f'{name}: {maybe_key}')

return maybe_key


Expand Down
7 changes: 4 additions & 3 deletions kmk/modules/holdtap.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from micropython import const

from kmk.keys import KC, make_argumented_key
from kmk.keys import make_argumented_key
from kmk.modules import Module
from kmk.utils import Debug

Expand Down Expand Up @@ -51,10 +51,11 @@ def __init__(
class HoldTap(Module):
tap_time = 300

def __init__(self):
def __init__(self, _make_key=True):
self.key_buffer = []
self.key_states = {}
if KC.get('HT') == KC.NO:

if _make_key:
make_argumented_key(
validator=HoldTapKeyMeta,
names=('HT',),
Expand Down
2 changes: 1 addition & 1 deletion kmk/modules/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(
combo_layers=None,
):
# Layers
super().__init__()
super().__init__(_make_key=False)
self.combo_layers = combo_layers
make_argumented_key(
validator=layer_key_validator,
Expand Down
2 changes: 1 addition & 1 deletion kmk/modules/tapdance.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(self, *keys, tap_time=None):

class TapDance(HoldTap):
def __init__(self):
super().__init__()
super().__init__(_make_key=False)
make_argumented_key(
validator=TapDanceKeyMeta,
names=('TD',),
Expand Down

0 comments on commit 0e1022c

Please sign in to comment.