diff options
author | QMK Bot <hello@qmk.fm> | 2022-03-24 20:14:36 +0000 |
---|---|---|
committer | QMK Bot <hello@qmk.fm> | 2022-03-24 20:14:36 +0000 |
commit | 2957f60dc10d479d94508263d5741917051ed28d (patch) | |
tree | c3ae126c92e78d6f86097c9d44d6ea2d402124af /lib/python/qmk/keymap.py | |
parent | dc9eb21332b0fc274cc69358032dc923da6dc306 (diff) | |
parent | efc9c525b19b33c6e09057218ea64f07f45f9555 (diff) |
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'lib/python/qmk/keymap.py')
-rw-r--r-- | lib/python/qmk/keymap.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/python/qmk/keymap.py b/lib/python/qmk/keymap.py index 00b5a78a5a..ca5be0959b 100644 --- a/lib/python/qmk/keymap.py +++ b/lib/python/qmk/keymap.py @@ -158,7 +158,7 @@ def is_keymap_dir(keymap, c=True, json=True, additional_files=None): return True -def generate_json(keymap, keyboard, layout, layers): +def generate_json(keymap, keyboard, layout, layers, macros=None): """Returns a `keymap.json` for the specified keyboard, layout, and layers. Args: @@ -173,11 +173,16 @@ def generate_json(keymap, keyboard, layout, layers): layers An array of arrays describing the keymap. Each item in the inner array should be a string that is a valid QMK keycode. + + macros + A sequence of strings containing macros to implement for this keyboard. """ new_keymap = template_json(keyboard) new_keymap['keymap'] = keymap new_keymap['layout'] = layout new_keymap['layers'] = layers + if macros: + new_keymap['macros'] = macros return new_keymap |