Add support for millisecond delays within a macro sequence

This commit is contained in:
Josh Klar
2018-09-30 21:34:16 -07:00
parent 2c05efa805
commit fde9b7e274
4 changed files with 28 additions and 1 deletions

View File

@@ -40,12 +40,15 @@ class RawKeycodes:
KC_UC_MODE = 1109
KC_MACRO_SLEEP_MS = 1110
# These shouldn't have all the fancy shenanigans Keycode allows
# such as no_press, because they modify KMK internal state in
# ways we need to tightly control. Thus, we can get away with
# a lighter-weight namedtuple implementation here
LayerKeycode = namedtuple('LayerKeycode', ('code', 'layer'))
MacroSleepKeycode = namedtuple('MacroSleepKeycode', ('code', 'ms'))
class UnicodeModeKeycode(namedtuple('UnicodeModeKeycode', ('code', 'mode'))):
@@ -455,6 +458,10 @@ class KMK(KeycodeCategory):
)
KC_UC_MODE_WINC = UnicodeModeKeycode.from_mode_const(UnicodeModes.WINC)
@staticmethod
def KC_MACRO_SLEEP_MS(ms):
return MacroSleepKeycode(RawKeycodes.KC_MACRO_SLEEP_MS, ms)
class Layers(KeycodeCategory):
@staticmethod