diff options
| author | Joel Challis | 2026-02-09 01:59:34 +0100 |
|---|---|---|
| committer | GitHub | 2026-02-09 01:59:34 +0100 |
| commit | b6d46cdc47d420d80c2c15e62c2b70c771166687 (patch) | |
| tree | 9b3d2880920695f93e9416b97f3d81bda8ce6af4 | |
| parent | 6729379041bced3064348395b0bdfed35d61c541 (diff) | |
Allow json keymaps to include a user provided keymap.h (#25987)
| -rw-r--r-- | lib/python/qmk/cli/generate/keymap_h.py | 7 |
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: |