Switch to OpenSans and add further layers

This commit is contained in:
Johannes Marbach 2021-10-12 21:00:27 +02:00
parent d069306bdb
commit 6c26bc87dd
8 changed files with 15652 additions and 14520 deletions

BIN
OpenSans-Regular.ttf Normal file

Binary file not shown.

View file

@ -66,16 +66,18 @@ With meson <0.55 use `ninja` instead of `meson compile`.
## Fonts
In order to work with [LVGL], fonts need to be converted to bitmaps, stored as C arrays. Buffyboard currently uses a combination of the [Montserrat] font for text and the [FontAwesome] font for pictograms. For both fonts only limited character ranges are included to reduce the binary size. To (re)generate the C file containing the combined font, run the following command
In order to work with [LVGL], fonts need to be converted to bitmaps, stored as C arrays. Buffyboard currently uses a combination of the [OpenSans] font for text and the [FontAwesome] font for pictograms. For both fonts only limited character ranges are included to reduce the binary size. To (re)generate the C file containing the combined font, run the following command
```
$ npx lv_font_conv --bpp 4 --size 32 --no-compress -o montserrat_extended_32.c --format lvgl \
--font Montserrat-Regular.ttf \
$ npx lv_font_conv --bpp 4 --size 32 --no-compress -o font_32.c --format lvgl \
--font OpenSans-Regular.ttf \
--range '0x0020-0x007F' \
--range '0x00A0-0x00FF' \
--range '0x0100-0x017F' \
--range '0x0370-0x03FF' \
--range '0x2000-0x206F' \
--range '0x20A0-0x20CF' \
--range '0x2200-0x22FF' \
--font FontAwesome5-Solid+Brands+Regular.woff \
--range '0xF001,0xF008,0xF00B,0xF00C,0xF00D,0xF011,0xF013,0xF015,0xF019,0xF01C,0xF021,0xF026,0xF027,0xF028,0xF03E,0xF0E0,0xF304,0xF043,0xF048,0xF04B,0xF04C,0xF04D,0xF051,0xF052,0xF053,0xF054,0xF067,0xF068,0xF06E,0xF070,0xF071,0xF074,0xF077,0xF078,0xF079,0xF07B,0xF093,0xF095,0xF0C4,0xF0C5,0xF0C7,0xF0C9,0xF0E7,0xF0EA,0xF0F3,0xF11C,0xF124,0xF158,0xF1EB,0xF240,0xF241,0xF242,0xF243,0xF244,0xF287,0xF293,0xF2ED,0xF55A,0xF7C2,0xF8A2' \
--range '0xF35B'
@ -83,12 +85,14 @@ $ npx lv_font_conv --bpp 4 --size 32 --no-compress -o montserrat_extended_32.c -
Below is a short explanation of the different unicode ranges used above.
- [Montserrat]
- [OpenSans]
- Basic Latin (`0x0020-0x007F`)
- Latin-1 supplement (`0x00A0-0x00FF`)
- Latin extended A (`0x0100-0x017F`)
- Greek and Coptic (`0x0370-0x03FF`)
- General punctuation (`0x2000-0x206F`)
- Currency symbols (`0x20A0-0x20CF`)
- Mathematical operators (`0x2200-0x22FF`)
- [FontAwesome]
- Standard `LV_SYMBOL_*` glyphs (`0xF001,0xF008,0xF00B,0xF00C,0xF00D,0xF011,0xF013,0xF015,0xF019,0xF01C,0xF021,0xF026,0xF027,0xF028,0xF03E,0xF0E0,0xF304,0xF043,0xF048,0xF04B,0xF04C,0xF04D,0xF051,0xF052,0xF053,0xF054,0xF067,0xF068,0xF06E,0xF070,0xF071,0xF074,0xF077,0xF078,0xF079,0xF07B,0xF093,0xF095,0xF0C4,0xF0C5,0xF0C7,0xF0C9,0xF0E7,0xF0EA,0xF0F3,0xF11C,0xF124,0xF158,0xF1EB,0xF240,0xF241,0xF242,0xF243,0xF244,0xF287,0xF293,0xF2ED,0xF55A,0xF7C2,0xF8A2`)
- [arrow-alt-circle-up] (`0xF35B`)
@ -115,7 +119,7 @@ Buffyboard was inspired by [fbkeyboard].
Buffyboard is licensed under the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The [Montserrat] font is licensed under the Open Font License.
The [OpenSans] font is licensed under the Apache License 2.0.
The [FontAwesome] font is licensed under the Open Font License version 1.1.
@ -127,7 +131,7 @@ The [FontAwesome] font is licensed under the Open Font License version 1.1.
[FontAwesome]: https://fontawesome.com/
[LVGL]: https://lvgl.io
[Make it possible to set the variable offset for fbdev]: https://github.com/lvgl/lv_drivers/pull/164
[Montserrat]: https://fonts.google.com/specimen/Montserrat
[OpenSans]: https://fonts.google.com/specimen/Open+Sans
[arrow-alt-circle-up]: https://fontawesome.com/v5.15/icons/arrow-alt-circle-up?style=solid
[fbkeyboard]: https://github.com/bakonyiferenc/fbkeyboard
[feat(disp): Enable rendering to display subsection]: https://github.com/lvgl/lvgl/pull/2583

15456
font_32.c Normal file

File diff suppressed because it is too large Load diff

6
main.c
View file

@ -44,7 +44,7 @@
* Custom fonts
*/
LV_FONT_DECLARE(montserrat_extended_32);
LV_FONT_DECLARE(font_32);
/**
@ -128,7 +128,7 @@ static void terminal_resize_timer_cb(lv_timer_t *timer) {
}
static void set_theme(bool is_dark) {
lv_theme_default_init(NULL, lv_palette_main(LV_PALETTE_BLUE), lv_palette_main(LV_PALETTE_CYAN), is_dark, &montserrat_extended_32);
lv_theme_default_init(NULL, lv_palette_main(LV_PALETTE_BLUE), lv_palette_main(LV_PALETTE_CYAN), is_dark, &font_32);
}
static void keyboard_draw_part_begin_cb(lv_event_t *event) {
@ -325,7 +325,7 @@ int main(void) {
/* Initialise theme and styles */
set_theme(true);
lv_style_init(&style_text_normal);
lv_style_set_text_font(&style_text_normal, &montserrat_extended_32);
lv_style_set_text_font(&style_text_normal, &font_32);
/* Add keyboard */
keyboard = lv_keyboard_create(lv_scr_act());

View file

@ -26,9 +26,9 @@ project(
buffyboard_sources = [
'cursor.c',
'font_32.c',
'main.c',
'libinput_multi.c',
'montserrat_extended_32.c',
'sq2lv_layouts.c',
'terminal.c',
'uinput_device.c',

File diff suppressed because it is too large Load diff

View file

@ -16,14 +16,14 @@ static const char * const short_name_terminal_us = "terminal/us";
/* Layer: Lowercase letters - generated from base */
static const int num_keys_lower_terminal_us = 37;
static const int num_keys_lower_terminal_us = 38;
static const char * const keycaps_lower_terminal_us[] = { \
"Ctrl", "Alt", LV_SYMBOL_UP, LV_SYMBOL_DOWN, LV_SYMBOL_LEFT, LV_SYMBOL_RIGHT, "\n", \
"q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "\n", \
"a", "s", "d", "f", "g", "h", "j", "k", "l", "\n", \
SQ2LV_SYMBOL_SHIFT, "z", "x", "c", "v", "b", "n", "m", LV_SYMBOL_BACKSPACE, "\n", \
"123", " ", LV_SYMBOL_OK, "" \
"123", " ", ">_", LV_SYMBOL_OK, "" \
};
static const lv_btnmatrix_ctrl_t attributes_lower_terminal_us[] = { \
@ -31,7 +31,7 @@ static const lv_btnmatrix_ctrl_t attributes_lower_terminal_us[] = { \
LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, \
LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, \
SQ2LV_CTRL_MOD_INACTIVE | 3, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, SQ2LV_CTRL_NON_CHAR | 3, \
SQ2LV_CTRL_NON_CHAR | 3, 7, SQ2LV_CTRL_NON_CHAR | 3 \
SQ2LV_CTRL_NON_CHAR | 3, 7, SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3 \
};
static const int num_modifiers_lower_terminal_us = 2;
@ -40,14 +40,14 @@ static const int modifier_idxs_lower_terminal_us[] = { \
0, 1 \
};
static const int num_switchers_lower_terminal_us = 2;
static const int num_switchers_lower_terminal_us = 3;
static const int switcher_idxs_lower_terminal_us[] = { \
25, 34 \
25, 34, 36 \
};
static const int switcher_dests_lower_terminal_us[] = { \
1, 2 \
1, 2, 4 \
};
static const int num_scancodes_lower_terminal_us = 5;
@ -65,7 +65,7 @@ static const int scancode_idxs_lower_terminal_us[] = { \
6, 7, 8, 9, 10, 11, 12, 13, 14, 15, \
16, 17, 18, 19, 20, 21, 22, 23, 24, \
-1, 25, 26, 27, 28, 29, 30, 31, 32, \
-1, 33, 34 \
-1, 33, -1, 34 \
};
static const int scancode_nums_lower_terminal_us[] = { \
@ -73,19 +73,19 @@ static const int scancode_nums_lower_terminal_us[] = { \
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
1, 1, 1, 1, 1, 1, 1, 1, 1, \
0, 1, 1, 1, 1, 1, 1, 1, 1, \
0, 1, 1 \
0, 1, 0, 1 \
};
/* Layer: Uppercase letters - generated from upper */
static const int num_keys_upper_terminal_us = 37;
static const int num_keys_upper_terminal_us = 38;
static const char * const keycaps_upper_terminal_us[] = { \
"Ctrl", "Alt", "PgUp", "PgDn", "Home", "End", "\n", \
"Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", "\n", \
"A", "S", "D", "F", "G", "H", "J", "K", "L", "\n", \
SQ2LV_SYMBOL_SHIFT, "Z", "X", "C", "V", "B", "N", "M", LV_SYMBOL_BACKSPACE, "\n", \
"123", " ", LV_SYMBOL_OK, "" \
"123", " ", ">_", LV_SYMBOL_OK, "" \
};
static const lv_btnmatrix_ctrl_t attributes_upper_terminal_us[] = { \
@ -93,7 +93,7 @@ static const lv_btnmatrix_ctrl_t attributes_upper_terminal_us[] = { \
LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, \
LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, \
SQ2LV_CTRL_MOD_ACTIVE | 3, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, SQ2LV_CTRL_NON_CHAR | 3, \
SQ2LV_CTRL_NON_CHAR | 3, 7, SQ2LV_CTRL_NON_CHAR | 3 \
SQ2LV_CTRL_NON_CHAR | 3, 7, SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3 \
};
static const int num_modifiers_upper_terminal_us = 2;
@ -102,14 +102,14 @@ static const int modifier_idxs_upper_terminal_us[] = { \
0, 1 \
};
static const int num_switchers_upper_terminal_us = 2;
static const int num_switchers_upper_terminal_us = 3;
static const int switcher_idxs_upper_terminal_us[] = { \
25, 34 \
25, 34, 36 \
};
static const int switcher_dests_upper_terminal_us[] = { \
0, 2 \
0, 2, 4 \
};
static const int num_scancodes_upper_terminal_us = 5;
@ -127,7 +127,7 @@ static const int scancode_idxs_upper_terminal_us[] = { \
6, 8, 10, 12, 14, 16, 18, 20, 22, 24, \
26, 28, 30, 32, 34, 36, 38, 40, 42, \
-1, 44, 46, 48, 50, 52, 54, 56, 58, \
-1, 59, 60 \
-1, 59, -1, 60 \
};
static const int scancode_nums_upper_terminal_us[] = { \
@ -135,18 +135,18 @@ static const int scancode_nums_upper_terminal_us[] = { \
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
2, 2, 2, 2, 2, 2, 2, 2, 2, \
0, 2, 2, 2, 2, 2, 2, 2, 1, \
0, 1, 1 \
0, 1, 0, 1 \
};
/* Layer: Numbers / symbols - generated from numbers */
static const int num_keys_numbers_terminal_us = 38;
static const int num_keys_numbers_terminal_us = 39;
static const char * const keycaps_numbers_terminal_us[] = { \
"Ctrl", "Alt", LV_SYMBOL_UP, LV_SYMBOL_DOWN, LV_SYMBOL_LEFT, LV_SYMBOL_RIGHT, "\n", \
"1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "\n", \
"*", "#", "$", "/", "&", "-", "_", "+", "(", ")", "\n", \
",", "\"", "'", ":", ";", "!", "?", LV_SYMBOL_BACKSPACE, "\n", \
"τ=\", ",", """, "'", ":", ";", "!", "?", LV_SYMBOL_BACKSPACE, "\n", \
"ABC", " ", ".", LV_SYMBOL_OK, "" \
};
@ -154,7 +154,7 @@ static const lv_btnmatrix_ctrl_t attributes_numbers_terminal_us[] = { \
SQ2LV_CTRL_MOD_INACTIVE | 3, SQ2LV_CTRL_MOD_INACTIVE | 3, SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3, \
LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, \
LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, \
LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, SQ2LV_CTRL_NON_CHAR | 3, \
SQ2LV_CTRL_NON_CHAR | 3, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, SQ2LV_CTRL_NON_CHAR | 3, \
SQ2LV_CTRL_NON_CHAR | 3, 7, LV_BTNMATRIX_CTRL_POPOVER | 2, SQ2LV_CTRL_NON_CHAR | 3 \
};
@ -164,14 +164,14 @@ static const int modifier_idxs_numbers_terminal_us[] = { \
0, 1 \
};
static const int num_switchers_numbers_terminal_us = 1;
static const int num_switchers_numbers_terminal_us = 2;
static const int switcher_idxs_numbers_terminal_us[] = { \
34 \
26, 35 \
};
static const int switcher_dests_numbers_terminal_us[] = { \
0 \
3, 0 \
};
static const int num_scancodes_numbers_terminal_us = 5;
@ -188,7 +188,7 @@ static const int scancode_idxs_numbers_terminal_us[] = { \
0, 1, 2, 3, 4, 5, \
6, 7, 8, 9, 10, 11, 12, 13, 14, 15, \
16, 18, 20, 22, 23, 25, 26, 28, 30, 32, \
34, 35, 37, 38, 40, 41, 43, 45, \
-1, 34, 35, 37, 38, 40, 41, 43, 45, \
-1, 46, 47, 48 \
};
@ -196,13 +196,137 @@ static const int scancode_nums_numbers_terminal_us[] = { \
1, 1, 1, 1, 1, 1, \
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
2, 2, 2, 1, 2, 1, 2, 2, 2, 2, \
1, 2, 1, 2, 1, 2, 2, 1, \
0, 1, 2, 1, 2, 1, 2, 2, 1, \
0, 1, 1, 1 \
};
/* Layer: Symbols - generated from symbols */
static const int num_keys_symbols_terminal_us = 39;
static const char * const keycaps_symbols_terminal_us[] = { \
"Ctrl", "Alt", LV_SYMBOL_UP, LV_SYMBOL_DOWN, LV_SYMBOL_LEFT, LV_SYMBOL_RIGHT, "\n", \
"~", "`", "|", "·", "", "π", "τ", "÷", "×", "", "\n", \
"©", "®", "£", "", "¥", "^", "°", "@", "{", "}", "\n", \
"123", "\\", "%", "<", ">", "=", "[", "]", LV_SYMBOL_BACKSPACE, "\n", \
"ABC", " ", ".", LV_SYMBOL_OK, "" \
};
static const lv_btnmatrix_ctrl_t attributes_symbols_terminal_us[] = { \
SQ2LV_CTRL_MOD_INACTIVE | 3, SQ2LV_CTRL_MOD_INACTIVE | 3, SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3, \
LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, \
LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, \
SQ2LV_CTRL_NON_CHAR | 3, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, LV_BTNMATRIX_CTRL_POPOVER | 2, SQ2LV_CTRL_NON_CHAR | 3, \
SQ2LV_CTRL_NON_CHAR | 3, 7, LV_BTNMATRIX_CTRL_POPOVER | 2, SQ2LV_CTRL_NON_CHAR | 3 \
};
static const int num_modifiers_symbols_terminal_us = 2;
static const int modifier_idxs_symbols_terminal_us[] = { \
0, 1 \
};
static const int num_switchers_symbols_terminal_us = 2;
static const int switcher_idxs_symbols_terminal_us[] = { \
26, 35 \
};
static const int switcher_dests_symbols_terminal_us[] = { \
2, 0 \
};
static const int num_scancodes_symbols_terminal_us = 5;
static const int scancodes_symbols_terminal_us[] = { \
KEY_LEFTCTRL, KEY_LEFTALT, KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, \
KEY_LEFTSHIFT, KEY_GRAVE, KEY_GRAVE, KEY_LEFTSHIFT, KEY_BACKSLASH, \
KEY_LEFTSHIFT, KEY_6, KEY_LEFTSHIFT, KEY_2, KEY_LEFTSHIFT, KEY_LEFTBRACE, KEY_LEFTSHIFT, KEY_RIGHTBRACE, \
KEY_BACKSLASH, KEY_LEFTSHIFT, KEY_5, KEY_LEFTSHIFT, KEY_COMMA, KEY_LEFTSHIFT, KEY_DOT, KEY_EQUAL, KEY_LEFTBRACE, KEY_RIGHTBRACE, KEY_BACKSPACE, \
KEY_SPACE, KEY_DOT, KEY_ENTER \
};
static const int scancode_idxs_symbols_terminal_us[] = { \
0, 1, 2, 3, 4, 5, \
6, 8, 9, -1, -1, -1, -1, -1, -1, -1, \
-1, -1, -1, -1, -1, 11, -1, 13, 15, 17, \
-1, 19, 20, 22, 24, 26, 27, 28, 29, \
-1, 30, 31, 32 \
};
static const int scancode_nums_symbols_terminal_us[] = { \
1, 1, 1, 1, 1, 1, \
2, 1, 2, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 2, 0, 2, 2, 2, \
0, 1, 2, 2, 2, 1, 1, 1, 1, \
0, 1, 1, 1 \
};
/* Layer: Actions - generated from actions */
static const int num_keys_actions_terminal_us = 30;
static const char * const keycaps_actions_terminal_us[] = { \
"Ctrl", "Alt", "PgUp", "PgDn", "Home", "End", "\n", \
"F1", "F2", "F3", "F4", "F5", "F6", "\n", \
"F7", "F8", "F9", "F10", "F11", "F12", "\n", \
"Esc", "Tab", "Pause", "Insert", "", "Del", "\n", \
"ABC", "Menu", "Break", "", "", "", "" \
};
static const lv_btnmatrix_ctrl_t attributes_actions_terminal_us[] = { \
SQ2LV_CTRL_MOD_INACTIVE | 3, SQ2LV_CTRL_MOD_INACTIVE | 3, SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3, \
SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3, \
SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3, \
SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3, \
SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 3 \
};
static const int num_modifiers_actions_terminal_us = 2;
static const int modifier_idxs_actions_terminal_us[] = { \
0, 1 \
};
static const int num_switchers_actions_terminal_us = 1;
static const int switcher_idxs_actions_terminal_us[] = { \
24 \
};
static const int switcher_dests_actions_terminal_us[] = { \
0 \
};
static const int num_scancodes_actions_terminal_us = 5;
static const int scancodes_actions_terminal_us[] = { \
KEY_LEFTCTRL, KEY_LEFTALT, KEY_PAGEUP, KEY_PAGEDOWN, KEY_HOME, KEY_END, \
KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_F6, \
KEY_F7, KEY_F8, KEY_F9, KEY_F10, KEY_F11, KEY_F12, \
KEY_ESC, KEY_TAB, KEY_PAUSE, KEY_INSERT, KEY_UP, KEY_DELETE, \
KEY_COMPOSE, KEY_BREAK, KEY_LEFT, KEY_DOWN, KEY_RIGHT \
};
static const int scancode_idxs_actions_terminal_us[] = { \
0, 1, 2, 3, 4, 5, \
6, 7, 8, 9, 10, 11, \
12, 13, 14, 15, 16, 17, \
18, 19, 20, 21, 22, 23, \
-1, 24, 25, 26, 27, 28 \
};
static const int scancode_nums_actions_terminal_us[] = { \
1, 1, 1, 1, 1, 1, \
1, 1, 1, 1, 1, 1, \
1, 1, 1, 1, 1, 1, \
1, 1, 1, 1, 1, 1, \
0, 1, 1, 1, 1, 1 \
};
/* Layer array */
static const int num_layers_terminal_us = 3;
static const int num_layers_terminal_us = 5;
static const sq2lv_layer_t layers_terminal_us[] = {
{
@ -246,6 +370,34 @@ static const sq2lv_layer_t layers_terminal_us[] = {
.scancodes = scancodes_numbers_terminal_us,
.scancode_idxs = scancode_idxs_numbers_terminal_us,
.scancode_nums = scancode_nums_numbers_terminal_us
},
{
.num_keys = num_keys_symbols_terminal_us,
.keycaps = keycaps_symbols_terminal_us,
.attributes = attributes_symbols_terminal_us,
.num_modifiers = num_modifiers_symbols_terminal_us,
.modifier_idxs = modifier_idxs_symbols_terminal_us,
.num_switchers = num_switchers_symbols_terminal_us,
.switcher_idxs = switcher_idxs_symbols_terminal_us,
.switcher_dests = switcher_dests_symbols_terminal_us,
.num_scancodes = num_scancodes_symbols_terminal_us,
.scancodes = scancodes_symbols_terminal_us,
.scancode_idxs = scancode_idxs_symbols_terminal_us,
.scancode_nums = scancode_nums_symbols_terminal_us
},
{
.num_keys = num_keys_actions_terminal_us,
.keycaps = keycaps_actions_terminal_us,
.attributes = attributes_actions_terminal_us,
.num_modifiers = num_modifiers_actions_terminal_us,
.modifier_idxs = modifier_idxs_actions_terminal_us,
.num_switchers = num_switchers_actions_terminal_us,
.switcher_idxs = switcher_idxs_actions_terminal_us,
.switcher_dests = switcher_dests_actions_terminal_us,
.num_scancodes = num_scancodes_actions_terminal_us,
.scancodes = scancodes_actions_terminal_us,
.scancode_idxs = scancode_idxs_actions_terminal_us,
.scancode_nums = scancode_nums_actions_terminal_us
}
};
@ -271,7 +423,7 @@ const char * const sq2lv_layout_names =
const char * const sq2lv_layout_short_names =
"terminal/us";
const int sq2lv_num_unique_scancodes = 57;
const int sq2lv_num_unique_scancodes = 80;
const int sq2lv_unique_scancodes[] = {
KEY_LEFTCTRL, KEY_LEFTALT, KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, KEY_Q, KEY_W, KEY_E, KEY_R,
@ -279,5 +431,7 @@ const int sq2lv_unique_scancodes[] = {
KEY_G, KEY_H, KEY_J, KEY_K, KEY_L, KEY_Z, KEY_X, KEY_C, KEY_V, KEY_B,
KEY_N, KEY_M, KEY_BACKSPACE, KEY_SPACE, KEY_ENTER, KEY_PAGEUP, KEY_PAGEDOWN, KEY_HOME, KEY_END, KEY_LEFTSHIFT,
KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_0,
KEY_SLASH, KEY_MINUS, KEY_EQUAL, KEY_COMMA, KEY_APOSTROPHE, KEY_SEMICOLON, KEY_DOT
KEY_SLASH, KEY_MINUS, KEY_EQUAL, KEY_COMMA, KEY_APOSTROPHE, KEY_SEMICOLON, KEY_DOT, KEY_GRAVE, KEY_BACKSLASH, KEY_LEFTBRACE,
KEY_RIGHTBRACE, KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_F6, KEY_F7, KEY_F8, KEY_F9,
KEY_F10, KEY_F11, KEY_F12, KEY_ESC, KEY_TAB, KEY_PAUSE, KEY_INSERT, KEY_DELETE, KEY_COMPOSE, KEY_BREAK
};

@ -1 +1 @@
Subproject commit 07c5eef6222a274b8e52a9691b871da65403f43c
Subproject commit 3d93f7c46973931b7023aff53e36272496076708