From 345f19a5d763053cd9cea6698656d4a2a1000b23 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Fri, 21 Oct 2022 02:21:17 +0100 Subject: Add converter support to keymap.json (#18776) --- lib/python/qmk/cli/generate/config_h.py | 2 +- lib/python/qmk/cli/generate/rules_mk.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/python/qmk') diff --git a/lib/python/qmk/cli/generate/config_h.py b/lib/python/qmk/cli/generate/config_h.py index fa7c43788d..f64daba134 100755 --- a/lib/python/qmk/cli/generate/config_h.py +++ b/lib/python/qmk/cli/generate/config_h.py @@ -174,7 +174,7 @@ def generate_config_h(cli): # Determine our keyboard/keymap if cli.args.filename: user_keymap = parse_configurator_json(cli.args.filename) - kb_info_json = user_keymap.get('config', {}) + kb_info_json = dotty(user_keymap.get('config', {})) elif cli.args.keyboard: kb_info_json = dotty(info_json(cli.args.keyboard)) else: diff --git a/lib/python/qmk/cli/generate/rules_mk.py b/lib/python/qmk/cli/generate/rules_mk.py index 361d3c758a..1d708f371e 100755 --- a/lib/python/qmk/cli/generate/rules_mk.py +++ b/lib/python/qmk/cli/generate/rules_mk.py @@ -49,10 +49,12 @@ def process_mapping_rule(kb_info_json, rules_key, info_dict): def generate_rules_mk(cli): """Generates a rules.mk file from info.json. """ + converter = None # Determine our keyboard/keymap if cli.args.filename: user_keymap = parse_configurator_json(cli.args.filename) - kb_info_json = user_keymap.get('config', {}) + kb_info_json = dotty(user_keymap.get('config', {})) + converter = user_keymap.get('converter', None) elif cli.args.keyboard: kb_info_json = dotty(info_json(cli.args.keyboard)) else: @@ -88,6 +90,9 @@ def generate_rules_mk(cli): else: rules_mk_lines.append('CUSTOM_MATRIX ?= yes') + if converter: + rules_mk_lines.append(f'CONVERT_TO ?= {converter}') + # Show the results dump_lines(cli.args.output, rules_mk_lines) -- cgit v1.2.3