Keycode alias support.

This commit is contained in:
Nick Brassel 2025-02-07 23:51:53 +11:00
commit 519bd5ac45
No known key found for this signature in database
4 changed files with 12 additions and 2 deletions

View file

@ -47,6 +47,8 @@ def _render_keycodes(module_jsons):
first = False
else:
lines.append(f' {key},')
for alias in keycode.get('aliases', []):
lines.append(f' {alias} = {key},')
lines.append('')
lines.append(' LAST_COMMUNITY_MODULE_KEY')
lines.append('};')

View file

@ -256,5 +256,10 @@ class CommunityModuleJSONEncoder(QMKJSONEncoder):
return '03features'
if key == 'keycodes':
return '04keycodes'
elif self.indentation_level == 3: # keycodes
if key == 'key':
return '00key'
if key == 'aliases':
return '01aliases'
return key