aboutsummaryrefslogtreecommitdiffstats
path: root/lib/python
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/qmk/cli/generate/keymap_h.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/python/qmk/cli/generate/keymap_h.py b/lib/python/qmk/cli/generate/keymap_h.py
index a3aaa405c0..10be16391a 100644
--- a/lib/python/qmk/cli/generate/keymap_h.py
+++ b/lib/python/qmk/cli/generate/keymap_h.py
@@ -43,6 +43,13 @@ def generate_keymap_h(cli):
keymap_h_lines = [GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE, '#pragma once', '// clang-format off']
+ # Allow a potential keymap level keymap.h for items like user defined keycode aliases used within a keymap.json keymap
+ keymap_h_lines += [
+ '#if __has_include_next("keymap.h")',
+ '# include_next "keymap.h"',
+ '#endif',
+ ]
+
keymap_json = parse_configurator_json(cli.args.filename)
if 'keycodes' in keymap_json and keymap_json['keycodes'] is not None: