summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorQMK Bot <hello@qmk.fm>2023-03-09 22:39:30 +0000
committerQMK Bot <hello@qmk.fm>2023-03-09 22:39:30 +0000
commit57112d700a8689b9cad2de58f30e864a501f9cef (patch)
tree2ab430fda8543575718af259a73452fb58c2bd1b /lib
parent0ddb27249ec624f01bcbd02da23fe2b4d8d9a1c7 (diff)
parentceb8222e57d3ffff8506b5318cb6773d6cbd1119 (diff)
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'lib')
-rw-r--r--lib/python/qmk/info.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py
index 152e6ce7b6..b7ee055eef 100644
--- a/lib/python/qmk/info.py
+++ b/lib/python/qmk/info.py
@@ -71,6 +71,16 @@ def _validate(keyboard, info_data):
if len(layouts) == 0 or all(not layout.get('json_layout', False) for layout in layouts.values()):
_log_error(info_data, 'No LAYOUTs defined! Need at least one layout defined in info.json.')
+ # 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']])
+ if offset_x > 0:
+ _log_warning(info_data, f'Layout "{layout_name}" is offset on X axis by {offset_x}')
+
+ offset_y = min([k['y'] for k in layout_data['layout']])
+ if offset_y > 0:
+ _log_warning(info_data, f'Layout "{layout_name}" is offset on Y axis by {offset_y}')
+
# Providing only LAYOUT_all "because I define my layouts in a 3rd party tool"
if len(layouts) == 1 and 'LAYOUT_all' in layouts:
_log_warning(info_data, '"LAYOUT_all" should be "LAYOUT" unless additional layouts are provided.')