Beginnings of basic tap dance

This commit is contained in:
Josh Klar
2018-10-19 03:04:54 -07:00
parent cc1bfc657f
commit b0f8c58828
3 changed files with 83 additions and 16 deletions

View File

@@ -80,6 +80,7 @@ class RawKeycodes:
KC_MACRO = 1110
KC_MACRO_SLEEP_MS = 1111
KC_TAP_DANCE = 1113
# These shouldn't have all the fancy shenanigans Keycode allows
@@ -184,6 +185,13 @@ class Macro:
return self.keyup() if self.keyup else None
class TapDanceKeycode:
code = RawKeycodes.KC_TAP_DANCE
def __init__(self, *codes):
self.codes = codes
class KeycodeCategory(type):
@classmethod
def to_dict(cls):
@@ -551,6 +559,13 @@ class KMK(KeycodeCategory):
def KC_MACRO_SLEEP_MS(ms):
return MacroSleepKeycode(RawKeycodes.KC_MACRO_SLEEP_MS, ms)
@staticmethod
def KC_TAP_DANCE(*args):
return TapDanceKeycode(*args)
KMK.KC_TD = KMK.KC_TAP_DANCE
class Layers(KeycodeCategory):
@staticmethod