From 79b0f9168eafef1642f3223500197bf630a2433f Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Mon, 27 Mar 2023 20:01:07 +0100 Subject: Custom keycodes in JSON (#19925) --- lib/python/qmk/info.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/python/qmk/info.py') diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py index b7ee055eef..f4dcc507ef 100644 --- a/lib/python/qmk/info.py +++ b/lib/python/qmk/info.py @@ -103,6 +103,12 @@ def _validate(keyboard, info_data): if layout_name not in layouts and layout_name not in layout_aliases: _log_error(info_data, 'Claims to support community layout %s but no %s() macro found' % (layout, layout_name)) + # keycodes with length > 7 must have short forms for visualisation purposes + for decl in info_data.get('keycodes', []): + if len(decl["key"]) > 7: + if not decl.get("aliases", []): + _log_error(info_data, f'Keycode {decl["key"]} has no short form alias') + def info_json(keyboard): """Generate the info.json data for a specific keyboard. -- cgit v1.2.3