1
0
Fork 0

Small tweaks to keymap generation (#24240)

This commit is contained in:
Ryan 2024-08-04 21:28:40 +10:00 committed by GitHub
parent 5c10bd3d8c
commit 1f942bb17e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 9 deletions

View file

@ -40,7 +40,6 @@ __ENCODER_MAP_GOES_HERE__
#endif // defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE)
__MACRO_OUTPUT_GOES_HERE__
"""
@ -51,7 +50,7 @@ def _generate_keymap_table(keymap_json):
lines[-1] = lines[-1] + ','
layer = map(_strip_any, layer)
layer_keys = ', '.join(layer)
lines.append('\t[%s] = %s(%s)' % (layer_num, keymap_json['layout'], layer_keys))
lines.append(' [%s] = %s(%s)' % (layer_num, keymap_json['layout'], layer_keys))
return lines
@ -61,7 +60,7 @@ def _generate_encodermap_table(keymap_json):
if layer_num != 0:
lines[-1] = lines[-1] + ','
encoder_keycode_txt = ', '.join([f'ENCODER_CCW_CW({_strip_any(e["ccw"])}, {_strip_any(e["cw"])})' for e in layer])
lines.append('\t[%s] = {%s}' % (layer_num, encoder_keycode_txt))
lines.append(' [%s] = {%s}' % (layer_num, encoder_keycode_txt))
return lines