From d3073ef4943c70a3942ac91bb46fdc1a90f9e566 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sun, 13 Nov 2022 08:05:46 -0800 Subject: Add pointing device support to data driven config (#18215) Co-authored-by: Joel Challis --- lib/python/qmk/cli/generate/config_h.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/python') diff --git a/lib/python/qmk/cli/generate/config_h.py b/lib/python/qmk/cli/generate/config_h.py index 31b8d70635..51051ef610 100755 --- a/lib/python/qmk/cli/generate/config_h.py +++ b/lib/python/qmk/cli/generate/config_h.py @@ -126,6 +126,13 @@ def generate_encoder_config(encoder_json, config_h_lines, postfix=''): config_h_lines.append(generate_define(f'ENCODER_RESOLUTIONS{postfix}', f'{{ {", ".join(map(str,resolutions))} }}')) +def generate_pointing_device_config(pointing_device_json, config_h_lines, postfix=''): + + rotation = pointing_device_json.get('rotation', 0) + + generate_define(f'POINTING_DEVICE_ROTATION_{rotation}{postfix}') + + def generate_split_config(kb_info_json, config_h_lines): """Generate the config.h lines for split boards.""" if 'primary' in kb_info_json['split']: @@ -156,6 +163,9 @@ def generate_split_config(kb_info_json, config_h_lines): if 'right' in kb_info_json['split'].get('encoder', {}): generate_encoder_config(kb_info_json['split']['encoder']['right'], config_h_lines, '_RIGHT') + if 'right' in kb_info_json['split'].get('pointing_device', {}): + generate_pointing_device_config(kb_info_json['split']['pointing_device']['right'], config_h_lines, '_RIGHT') + def generate_led_animations_config(led_feature_json, config_h_lines, prefix): for animation in led_feature_json.get('animations', {}): @@ -207,5 +217,8 @@ def generate_config_h(cli): if 'rgblight' in kb_info_json: generate_led_animations_config(kb_info_json['rgblight'], config_h_lines, 'RGBLIGHT_EFFECT_') + if 'pointing_device' in kb_info_json: + generate_pointing_device_config(kb_info_json['pointing_device'], config_h_lines) + # Show the results dump_lines(cli.args.output, config_h_lines, cli.args.quiet) -- cgit v1.2.3