Make eschar key depend on layout
This commit is contained in:
parent
0b492ab0d8
commit
37b2ff53f7
4 changed files with 98 additions and 52 deletions
105
layouts.c
105
layouts.c
|
|
@ -49,6 +49,7 @@
|
|||
}
|
||||
|
||||
/* Special characters */
|
||||
#define TRIGGER_SPECIAL_US NULL
|
||||
#define KEYS_SPECIAL_US { NULL }
|
||||
#define ATTRIBUTES_SPECIAL_US { 0 }
|
||||
|
||||
|
|
@ -63,7 +64,7 @@
|
|||
"a", "z", "e", "r", "t", "y", "u", "i", "o", "p", "\n", \
|
||||
"q", "s", "d", "f", "g", "h", "j", "k", "l", "m", "\n", \
|
||||
"ABC", "w", "x", "c", "v", "b", "n", ".", LV_SYMBOL_BACKSPACE, "\n", \
|
||||
"1#", LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, "àéö", LV_SYMBOL_OK, "" \
|
||||
"1#", LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, "àéô", LV_SYMBOL_OK, "" \
|
||||
}
|
||||
#define ATTRIBUTES_LOWER_FR { \
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||
|
|
@ -77,7 +78,7 @@
|
|||
"A", "Z", "E", "R", "T", "Y", "U", "I", "O", "P", "\n", \
|
||||
"Q", "S", "D", "F", "G", "H", "J", "K", "L", "M", "\n", \
|
||||
"abc", "W", "X", "C", "V", "B", "N", ",", LV_SYMBOL_BACKSPACE, "\n", \
|
||||
"1#", LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, "àéö", LV_SYMBOL_OK, "" \
|
||||
"1#", LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, "àéô", LV_SYMBOL_OK, "" \
|
||||
}
|
||||
#define ATTRIBUTES_UPPER_FR { \
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||
|
|
@ -91,7 +92,7 @@
|
|||
"1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "\n", \
|
||||
"@", "#", "€", "%", "&", "-", "_", "+", "(", ")", "\n", \
|
||||
",", "\"", "'", ":", ";", "!", "?", LV_SYMBOL_BACKSPACE, "\n", \
|
||||
"abc", LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, "àéö", LV_SYMBOL_OK, "" \
|
||||
"abc", LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, "àéô", LV_SYMBOL_OK, "" \
|
||||
}
|
||||
#define ATTRIBUTES_NUMBERS_FR { \
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||
|
|
@ -101,11 +102,12 @@
|
|||
}
|
||||
|
||||
/* Special characters */
|
||||
#define TRIGGER_SPECIAL_FR "àéô"
|
||||
#define KEYS_SPECIAL_FR { \
|
||||
"à", "â", "ç", "é", "è", "ê", "î", "ô", "ù", "û", "\n", \
|
||||
"À", "Â", "Ç", "É", "È", "Ê", "Î", "Ô", "Ù", "Û", "\n", \
|
||||
"1#", "æ", "œ", "ä", "ë", "ï", "ö", "ü", LV_SYMBOL_BACKSPACE, "\n", \
|
||||
"abc", LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, "àéö", LV_SYMBOL_OK, "" \
|
||||
"abc", LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, "àéô", LV_SYMBOL_OK, "" \
|
||||
}
|
||||
#define ATTRIBUTES_SPECIAL_FR { \
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||
|
|
@ -125,7 +127,7 @@
|
|||
"q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "\n", \
|
||||
"a", "s", "d", "f", "g", "h", "j", "k", "l", "ñ", "\n", \
|
||||
"ABC", "z", "x", "c", "v", "b", "n", "m", LV_SYMBOL_BACKSPACE, "\n", \
|
||||
"1#", "àéö", LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, "?", ".", LV_SYMBOL_OK, "" \
|
||||
"1#", "áéí", LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, "?", ".", LV_SYMBOL_OK, "" \
|
||||
}
|
||||
#define ATTRIBUTES_LOWER_ES { \
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||
|
|
@ -139,7 +141,7 @@
|
|||
"Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", "\n", \
|
||||
"A", "S", "D", "F", "G", "H", "J", "K", "L", "Ñ", "\n", \
|
||||
"abc", "Z", "X", "C", "V", "B", "N", "M", LV_SYMBOL_BACKSPACE, "\n", \
|
||||
"1#", "àéö", LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, "¿", ".", LV_SYMBOL_OK, "" \
|
||||
"1#", "áéí", LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, "¿", ".", LV_SYMBOL_OK, "" \
|
||||
}
|
||||
#define ATTRIBUTES_UPPER_ES { \
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||
|
|
@ -153,7 +155,7 @@
|
|||
"1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "\n", \
|
||||
"@", "#", "€", "%", "&", "-", "_", "+", "(", ")", "\n", \
|
||||
",", "\"", "'", ":", ";", "!", "=", LV_SYMBOL_BACKSPACE, "\n", \
|
||||
"abc", "àéö", LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, "?", ".", LV_SYMBOL_OK, "" \
|
||||
"abc", "áéí", LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, "?", ".", LV_SYMBOL_OK, "" \
|
||||
}
|
||||
#define ATTRIBUTES_NUMBERS_ES { \
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||
|
|
@ -163,11 +165,12 @@
|
|||
}
|
||||
|
||||
/* Special characters */
|
||||
#define TRIGGER_SPECIAL_ES "áéí"
|
||||
#define KEYS_SPECIAL_ES { \
|
||||
"á", "é", "í", "ó", "ú", "Á", "É", "Í", "Ó", "Ú", "\n", \
|
||||
"à", "è", "ì", "ò", "ù", "À", "È", "Ì", "Ò", "Ù", "\n", \
|
||||
"1#", "ü", "ç", "ï", "Ü", "Ç", "Ï", "¡", LV_SYMBOL_BACKSPACE, "\n", \
|
||||
"abc", "àéö", LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, "«", "»", LV_SYMBOL_OK, "" \
|
||||
"abc", "áéí", LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, "«", "»", LV_SYMBOL_OK, "" \
|
||||
}
|
||||
#define ATTRIBUTES_SPECIAL_ES { \
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||
|
|
@ -187,7 +190,7 @@
|
|||
"q", "w", "e", "r", "t", "z", "u", "i", "o", "p", "\n", \
|
||||
"a", "s", "d", "f", "g", "h", "j", "k", "l", "\n", \
|
||||
"ABC", "y", "x", "c", "v", "b", "n", "m", LV_SYMBOL_BACKSPACE, "\n", \
|
||||
"1#", "àéö", LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, ",", ".", LV_SYMBOL_OK, "" \
|
||||
"1#", "äöü", LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, ",", ".", LV_SYMBOL_OK, "" \
|
||||
}
|
||||
#define ATTRIBUTES_LOWER_DE { \
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||
|
|
@ -201,7 +204,7 @@
|
|||
"Q", "W", "E", "R", "T", "Z", "U", "I", "O", "P", "\n", \
|
||||
"A", "S", "D", "F", "G", "H", "J", "K", "L", "\n", \
|
||||
"abc", "Y", "X", "C", "V", "B", "N", "M", LV_SYMBOL_BACKSPACE, "\n", \
|
||||
"1#", "àéö", LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, "!", "?", LV_SYMBOL_OK, "" \
|
||||
"1#", "äöü", LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, "!", "?", LV_SYMBOL_OK, "" \
|
||||
}
|
||||
#define ATTRIBUTES_UPPER_DE { \
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||
|
|
@ -215,7 +218,7 @@
|
|||
"1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "\n", \
|
||||
"@", "#", "€", "%", "&", "-", "_", "+", "(", ")", "\n", \
|
||||
";", "\"", "'", ":", "=", "<", ">", LV_SYMBOL_BACKSPACE, "\n", \
|
||||
"abc", "àéö", LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, ",", ".", LV_SYMBOL_OK, "" \
|
||||
"abc", "äöü", LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, ",", ".", LV_SYMBOL_OK, "" \
|
||||
}
|
||||
#define ATTRIBUTES_NUMBERS_DE { \
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||
|
|
@ -225,11 +228,12 @@
|
|||
}
|
||||
|
||||
/* Special characters */
|
||||
#define TRIGGER_SPECIAL_DE "äöü"
|
||||
#define KEYS_SPECIAL_DE { \
|
||||
"ä", "è", "é", "ö", "ü", "Ä", "È", "É", "Ö", "Ü", "\n", \
|
||||
"à", "â", "ê", "î", "ô", "À", "Â", "È", "Î", "Ô", "\n", \
|
||||
"1#", "«", "»", "ç", "Ç", "æ", "œ", "ß", LV_SYMBOL_BACKSPACE, "\n", \
|
||||
"abc", "àéö", LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, "„", "“", LV_SYMBOL_OK, "" \
|
||||
"abc", "äöü", LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, "„", "“", LV_SYMBOL_OK, "" \
|
||||
}
|
||||
#define ATTRIBUTES_SPECIAL_DE { \
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||
|
|
@ -249,59 +253,65 @@ static const char * const names =
|
|||
LV_SYMBOL_KEYBOARD " " NAME_DE;
|
||||
|
||||
static const char ** const keys_lower[] = {
|
||||
(const char * const [])KEYS_LOWER_US, \
|
||||
(const char * const [])KEYS_LOWER_FR, \
|
||||
(const char * const [])KEYS_LOWER_ES, \
|
||||
(const char * const [])KEYS_LOWER_DE \
|
||||
(const char * const [])KEYS_LOWER_US,
|
||||
(const char * const [])KEYS_LOWER_FR,
|
||||
(const char * const [])KEYS_LOWER_ES,
|
||||
(const char * const [])KEYS_LOWER_DE
|
||||
};
|
||||
|
||||
static const lv_btnmatrix_ctrl_t * const attributes_lower[] = {
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_LOWER_US, \
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_LOWER_FR, \
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_LOWER_ES, \
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_LOWER_DE \
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_LOWER_US,
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_LOWER_FR,
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_LOWER_ES,
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_LOWER_DE
|
||||
};
|
||||
|
||||
static const char ** const keys_upper[] = {
|
||||
(const char * const [])KEYS_UPPER_US, \
|
||||
(const char * const [])KEYS_UPPER_FR, \
|
||||
(const char * const [])KEYS_UPPER_ES, \
|
||||
(const char * const [])KEYS_UPPER_DE \
|
||||
(const char * const [])KEYS_UPPER_US,
|
||||
(const char * const [])KEYS_UPPER_FR,
|
||||
(const char * const [])KEYS_UPPER_ES,
|
||||
(const char * const [])KEYS_UPPER_DE
|
||||
};
|
||||
|
||||
static const lv_btnmatrix_ctrl_t * const attributes_upper[] = {
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_UPPER_US, \
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_UPPER_FR, \
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_UPPER_ES, \
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_UPPER_DE \
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_UPPER_US,
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_UPPER_FR,
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_UPPER_ES,
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_UPPER_DE
|
||||
};
|
||||
|
||||
static const char ** const keys_numbers[] = {
|
||||
(const char * const [])KEYS_NUMBERS_US, \
|
||||
(const char * const [])KEYS_NUMBERS_FR, \
|
||||
(const char * const [])KEYS_NUMBERS_ES, \
|
||||
(const char * const [])KEYS_NUMBERS_DE \
|
||||
(const char * const [])KEYS_NUMBERS_US,
|
||||
(const char * const [])KEYS_NUMBERS_FR,
|
||||
(const char * const [])KEYS_NUMBERS_ES,
|
||||
(const char * const [])KEYS_NUMBERS_DE
|
||||
};
|
||||
|
||||
static const lv_btnmatrix_ctrl_t * const attributes_numbers[] = {
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_NUMBERS_US, \
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_NUMBERS_FR, \
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_NUMBERS_ES, \
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_NUMBERS_DE \
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_NUMBERS_US,
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_NUMBERS_FR,
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_NUMBERS_ES,
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_NUMBERS_DE
|
||||
};
|
||||
|
||||
static const char * const triggers_special[] = {
|
||||
(const char * const)TRIGGER_SPECIAL_US,
|
||||
(const char * const)TRIGGER_SPECIAL_FR,
|
||||
(const char * const)TRIGGER_SPECIAL_ES,
|
||||
(const char * const)TRIGGER_SPECIAL_DE
|
||||
};
|
||||
static const char ** const keys_special[] = {
|
||||
(const char * const [])KEYS_SPECIAL_US, \
|
||||
(const char * const [])KEYS_SPECIAL_FR, \
|
||||
(const char * const [])KEYS_SPECIAL_ES, \
|
||||
(const char * const [])KEYS_SPECIAL_DE \
|
||||
(const char * const [])KEYS_SPECIAL_US,
|
||||
(const char * const [])KEYS_SPECIAL_FR,
|
||||
(const char * const [])KEYS_SPECIAL_ES,
|
||||
(const char * const [])KEYS_SPECIAL_DE
|
||||
};
|
||||
|
||||
static const lv_btnmatrix_ctrl_t * const attributes_special[] = {
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_SPECIAL_US, \
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_SPECIAL_FR, \
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_SPECIAL_ES, \
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_SPECIAL_DE \
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_SPECIAL_US,
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_SPECIAL_FR,
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_SPECIAL_ES,
|
||||
(lv_btnmatrix_ctrl_t[])ATTRIBUTES_SPECIAL_DE
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -312,6 +322,13 @@ char *get_layout_names(void) {
|
|||
return names;
|
||||
}
|
||||
|
||||
char *get_special_layer_trigger(layout_t layout) {
|
||||
if (layout < 0 || layout >= NUM_LAYOUTS) {
|
||||
return NULL;
|
||||
}
|
||||
return triggers_special[layout];
|
||||
}
|
||||
|
||||
void apply_layout(lv_obj_t *keyboard, layout_t layout) {
|
||||
if (layout < 0 || layout >= NUM_LAYOUTS) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ typedef enum {
|
|||
#define NUM_LAYOUTS 4
|
||||
|
||||
char *get_layout_names(void);
|
||||
char *get_special_layer_trigger(layout_t layout);
|
||||
void apply_layout(lv_obj_t *keyboard, layout_t layout);
|
||||
|
||||
#endif /* LAYOUTS_H */
|
||||
15
main.c
15
main.c
|
|
@ -135,6 +135,8 @@ lv_obj_t *keyboard = NULL;
|
|||
|
||||
lv_style_t style_text_normal;
|
||||
|
||||
char *special_layer_trigger = NULL;
|
||||
|
||||
// Helpers
|
||||
|
||||
void set_theme(bool is_dark);
|
||||
|
|
@ -178,7 +180,7 @@ void keyboard_event_value_changed_cb(lv_event_t * e) {
|
|||
const char * txt = lv_btnmatrix_get_btn_text(obj, lv_btnmatrix_get_selected_btn(obj));
|
||||
if(txt == NULL) return;
|
||||
|
||||
if(strcmp(txt, "àéö") == 0) {
|
||||
if(strcmp(txt, special_layer_trigger) == 0) {
|
||||
lv_keyboard_set_mode(keyboard, LV_KEYBOARD_MODE_NUMBER);
|
||||
} else {
|
||||
lv_keyboard_def_event_cb(e);
|
||||
|
|
@ -211,9 +213,12 @@ void keymap_dropdown_event_cb(lv_event_t *e) {
|
|||
lv_obj_add_style(lv_dropdown_get_list(lv_event_get_target(e)), &style_text_normal, 0);
|
||||
break;
|
||||
}
|
||||
case LV_EVENT_VALUE_CHANGED:
|
||||
apply_layout(keyboard, lv_dropdown_get_selected(lv_event_get_target(e)));
|
||||
case LV_EVENT_VALUE_CHANGED: {
|
||||
uint16_t idx = lv_dropdown_get_selected(lv_event_get_target(e));
|
||||
apply_layout(keyboard, idx);
|
||||
special_layer_trigger = get_special_layer_trigger(idx);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -442,7 +447,9 @@ int main(void)
|
|||
lv_label_set_text(power_btn_label, LV_SYMBOL_POWER);
|
||||
lv_obj_add_event_cb(power_btn, power_btn_event_cb, LV_EVENT_CLICKED, NULL);
|
||||
|
||||
apply_layout(keyboard, 0); // Apply default layout
|
||||
// Apply default layout
|
||||
apply_layout(keyboard, 0);
|
||||
special_layer_trigger = get_special_layer_trigger(0);
|
||||
|
||||
// Run lvgl in tickless mode
|
||||
while(1) {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,11 @@ key_map = {
|
|||
'base': 'ABC',
|
||||
'upper': 'abc'
|
||||
},
|
||||
'show_eschars': 'àéö',
|
||||
'show_eschars': {
|
||||
'de': 'äöü',
|
||||
'es': 'áéí',
|
||||
'fr': 'àéô'
|
||||
},
|
||||
'show_letters': 'abc',
|
||||
'show_numbers': '1#',
|
||||
'show_numbers_from_symbols': '1#',
|
||||
|
|
@ -67,7 +71,12 @@ def load_yaml(path):
|
|||
def map_key(key, layer, name):
|
||||
mapped = key_map[key] if key in key_map else key
|
||||
if isinstance(mapped, dict):
|
||||
mapped = mapped[layer] if layer in mapped else None
|
||||
if layer in mapped:
|
||||
mapped = mapped[layer]
|
||||
elif name in mapped:
|
||||
mapped = mapped[name]
|
||||
else:
|
||||
None
|
||||
if not mapped:
|
||||
return []
|
||||
if isinstance(mapped, list):
|
||||
|
|
@ -112,10 +121,15 @@ if __name__ == '__main__':
|
|||
for layer in layer_whitelist:
|
||||
print(f'/* {layer_to_description[layer]} */')
|
||||
if layer not in data['views']:
|
||||
print(f'#define TRIGGER_{map_layer(layer).upper()}_{name.upper()} NULL')
|
||||
print(f'#define KEYS_{map_layer(layer).upper()}_{name.upper()} ' + '{ NULL }')
|
||||
print(f'#define ATTRIBUTES_{map_layer(layer).upper()}_{name.upper()} ' + '{ 0 }\n')
|
||||
continue
|
||||
|
||||
if layer == 'eschars':
|
||||
key = map_key('show_eschars', layer, name)[0]
|
||||
print(f'#define TRIGGER_{map_layer(layer).upper()}_{name.upper()} "{key}"')
|
||||
|
||||
rows = data['views'][layer]
|
||||
keys_by_row = []
|
||||
attrs_by_row = []
|
||||
|
|
@ -156,15 +170,22 @@ if __name__ == '__main__':
|
|||
print(f' LV_SYMBOL_KEYBOARD " " NAME_{name.upper()}{suffix}')
|
||||
|
||||
for layer in layer_whitelist:
|
||||
if layer == 'eschars':
|
||||
print(f'static const char * const triggers_{map_layer(layer)}[] = ' + '{')
|
||||
for i, name in enumerate(layouts):
|
||||
suffix = ',' if i < len(layouts) - 1 else ''
|
||||
print(f' (const char * const)TRIGGER_{map_layer(layer).upper()}_{name.upper()}{suffix}')
|
||||
print('};')
|
||||
|
||||
print(f'static const char ** const keys_{map_layer(layer)}[] = ' + '{')
|
||||
for i, name in enumerate(layouts):
|
||||
suffix = ', \\' if i < len(layouts) - 1 else ' \\'
|
||||
suffix = ',' if i < len(layouts) - 1 else ''
|
||||
print(f' (const char * const [])KEYS_{map_layer(layer).upper()}_{name.upper()}{suffix}')
|
||||
print('};')
|
||||
print()
|
||||
print(f'static const lv_btnmatrix_ctrl_t * const attributes_{map_layer(layer)}[] = ' + '{')
|
||||
for i, name in enumerate(layouts):
|
||||
suffix = ', \\' if i < len(layouts) - 1 else ' \\'
|
||||
suffix = ',' if i < len(layouts) - 1 else ''
|
||||
print(f' (lv_btnmatrix_ctrl_t[])ATTRIBUTES_{map_layer(layer).upper()}_{name.upper()}{suffix}')
|
||||
print('};')
|
||||
print()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue