Custom keycodes in JSON

This commit is contained in:
zvecr
2023-02-23 23:02:38 +00:00
parent 6498acd2d3
commit 2731667ff4
12 changed files with 149 additions and 35 deletions
+6
View File
@@ -93,6 +93,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.