summaryrefslogtreecommitdiffstats
path: root/lib/python
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2022-11-13 08:05:46 -0800
committerGitHub <noreply@github.com>2022-11-14 03:05:46 +1100
commitd3073ef4943c70a3942ac91bb46fdc1a90f9e566 (patch)
treef04d3e5b85c31ba913c8401e6711958801db1825 /lib/python
parent8812872794b5fb09e6bbbe47a58cc7dbcaca18a7 (diff)
Add pointing device support to data driven config (#18215)
Co-authored-by: Joel Challis <git@zvecr.com>
Diffstat (limited to 'lib/python')
-rwxr-xr-xlib/python/qmk/cli/generate/config_h.py13
1 files changed, 13 insertions, 0 deletions
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)