1
0
Fork 0

Custom keycodes in JSON (#19925)

This commit is contained in:
Joel Challis 2023-03-27 20:01:07 +01:00 committed by GitHub
parent e35bb8ebfa
commit 79b0f9168e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 129 additions and 13 deletions

View file

@ -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.