summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2023-04-04 10:15:35 +1000
committerGitHub <noreply@github.com>2023-04-04 01:15:35 +0100
commit81f321d3318d4df0c442d11073a837984d4a8dbc (patch)
treefaf574d953b76fb8a028c071ed2fc6726dd323bf /lib
parent1dd2d1df20df5c4d0a24d117db96e588122158bc (diff)
`qmk info`: account for ISO enter when calculating layout X offset (#20325)
Diffstat (limited to 'lib')
-rw-r--r--lib/python/qmk/info.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py
index 924d31ac81..dbd26153d8 100644
--- a/lib/python/qmk/info.py
+++ b/lib/python/qmk/info.py
@@ -50,6 +50,11 @@ def _valid_community_layout(layout):
return (Path('layouts/default') / layout).exists()
+def _get_key_left_position(key):
+ # Special case for ISO enter
+ return key['x'] - 0.25 if key.get('h', 1) == 2 and key.get('w', 1) == 1.25 else key['x']
+
+
def _additional_validation(keyboard, info_data):
"""Non schema checks
"""
@@ -64,7 +69,7 @@ def _additional_validation(keyboard, info_data):
# Warn if physical positions are offset (at least one key should be at x=0, and at least one key at y=0)
for layout_name, layout_data in layouts.items():
- offset_x = min([k['x'] for k in layout_data['layout']])
+ offset_x = min([_get_key_left_position(k) for k in layout_data['layout']])
if offset_x > 0:
_log_warning(info_data, f'Layout "{layout_name}" is offset on X axis by {offset_x}')