commit 57c688c218c576c8282fbd625b72157c645088c8
parent 8abc3326dffd8a7772ebcc491eeceb10eb94c02c
Author: Stacy Harper <contact@stacyharper.net>
Date: Mon, 23 Aug 2021 23:23:03 +0200
Adapt sxmo_simple
Diffstat:
M | layout.mobile.h | | | 108 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----- |
1 file changed, 102 insertions(+), 6 deletions(-)
diff --git a/layout.mobile.h b/layout.mobile.h
@@ -48,6 +48,9 @@ enum layout_names {
ComposeB,
ComposeN,
ComposeM,
+ ComposeMath,
+ ComposePunctuation,
+ ComposeBracket,
ComposeCyrI,
ComposeCyrJ,
ComposeCyrE,
@@ -88,6 +91,9 @@ static struct key keys_full[], keys_special[], keys_simple[], keys_cyrillic[],
keys_compose_b[],
keys_compose_n[],
keys_compose_m[],
+ keys_compose_math[],
+ keys_compose_punctuation[],
+ keys_compose_bracket[],
keys_compose_cyr_i[],
keys_compose_cyr_j[],
keys_compose_cyr_e[],
@@ -130,6 +136,9 @@ static struct layout layouts[NumLayouts] = {
[ComposeB] = {keys_compose_b, 0, "latin"},
[ComposeN] = {keys_compose_n, 0, "latin"},
[ComposeM] = {keys_compose_m, 0, "latin"},
+ [ComposeMath] = {keys_compose_math, 0, "latin"},
+ [ComposePunctuation] = {keys_compose_punctuation, 0, "latin"},
+ [ComposeBracket] = {keys_compose_bracket, 0, "latin"},
[ComposeCyrI] = {keys_compose_cyr_i, 0, "cyrillic"},
[ComposeCyrJ] = {keys_compose_cyr_j, 0, "cyrillic"},
[ComposeCyrE] = {keys_compose_cyr_e, 0, "cyrillic"},
@@ -332,7 +341,7 @@ static struct key keys_special[] = {
};
static struct key keys_simple[] = {
- {"", "", 0.5, Pad},
+ {"Tab", "Tab", 0.5, Code, KEY_TAB, .scheme=1},
{"q", "Q", 1.0, Code, KEY_Q, &layouts[ComposeQ]},
{"w", "W", 1.0, Code, KEY_W, &layouts[ComposeW]},
{"e", "E", 1.0, Code, KEY_E, &layouts[ComposeE]},
@@ -355,7 +364,7 @@ static struct key keys_simple[] = {
{"j", "J", 1.0, Code, KEY_J, &layouts[ComposeJ]},
{"k", "K", 1.0, Code, KEY_K, &layouts[ComposeK]},
{"l", "L", 1.0, Code, KEY_L, &layouts[ComposeL]},
- {"", "", 0.5, Pad},
+ { "'", "\"", 0.5, Code, KEY_APOSTROPHE, &layouts[ComposeBracket]},
{"", "", 0.0, EndRow},
{"⇧", "⇧", 1.5, Mod, Shift, .scheme=1},
@@ -371,11 +380,10 @@ static struct key keys_simple[] = {
{"Abc", "Abc", 1.0, Layout, 0, &layouts[(DefaultLayout == Simple) ? Special : Cyrillic], .scheme=1 },
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme=1},
- {",", "'", 1.0, Code, KEY_COMMA},
+ {",", "'", 1.0, Code, KEY_COMMA, &layouts[ComposeMath]},
{"", "", 4.0, Code, KEY_SPACE},
- {".", "?", 1.0, Code, KEY_DOT},
- {"Entr", "Entr", 2.0, Code, KEY_ENTER, .scheme=1},
-
+ {".", "?", 1.0, Code, KEY_DOT, &layouts[ComposePunctuation]},
+ {"Enter", "Enter", 2.0, Code, KEY_ENTER, .scheme=1},
/* end of layout */
{"", "", 0.0, Last},
@@ -1235,3 +1243,91 @@ static struct key keys_compose_cyr_k[] = {
{"Enter", "Enter", 2.0, Code, KEY_ENTER, .scheme=1},
{"", "", 0.0, Last},
};
+
+static struct key keys_compose_math[] = {
+ {"1", "!", 1.0, Code, KEY_1},
+ {"2", "@", 1.0, Code, KEY_2},
+ {"3", "#", 1.0, Code, KEY_3},
+ {"4", "$", 1.0, Code, KEY_4},
+ {"5", "%", 1.0, Code, KEY_5},
+ {"6", "^", 1.0, Code, KEY_6},
+ {"7", "&", 1.0, Code, KEY_7},
+ {"8", "*", 1.0, Code, KEY_8},
+ {"9", "(", 1.0, Code, KEY_9},
+ {"0", ")", 1.0, Code, KEY_0},
+ {"", "", 0.0, EndRow},
+ {"", "", 10.0, Pad },
+ {"", "", 0.0, EndRow},
+ {"⇧", "⇧", 1, Mod, Shift},
+ {"-", "-", 1, Code, KEY_MINUS },
+ {"+", "+", 1, Code, KEY_EQUAL, 0, Shift },
+ {"/", "/", 1, Code, KEY_SLASH},
+ {"*", "*", 1, Code, KEY_8, 0, Shift },
+ {"=", "=", 1, Code, KEY_EQUAL},
+ {"_", "_", 1, Code, KEY_MINUS, 0, Shift },
+ {"", "", 4, Pad },
+ {"", "", 0.0, EndRow},
+ {"Abc", "Abc", 1.0, Layout, 0, &layouts[(DefaultLayout == Simple) ? Special : Cyrillic], .scheme=1 },
+ {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme=1},
+ {",", "'", 1.0, Code, KEY_COMMA, &layouts[ComposeMath]},
+ {"", "", 4.0, Code, KEY_SPACE},
+ {".", "?", 1.0, Code, KEY_DOT, &layouts[ComposePunctuation]},
+ {"Enter", "Enter", 2.0, Code, KEY_ENTER, .scheme=1},
+ {"", "", 0.0, Last},
+};
+
+static struct key keys_compose_punctuation[] = {
+ {"1", "!", 1.0, Code, KEY_1},
+ {"2", "@", 1.0, Code, KEY_2},
+ {"3", "#", 1.0, Code, KEY_3},
+ {"4", "$", 1.0, Code, KEY_4},
+ {"5", "%", 1.0, Code, KEY_5},
+ {"6", "^", 1.0, Code, KEY_6},
+ {"7", "&", 1.0, Code, KEY_7},
+ {"8", "*", 1.0, Code, KEY_8},
+ {"9", "(", 1.0, Code, KEY_9},
+ {"0", ")", 1.0, Code, KEY_0},
+ {"", "", 0.0, EndRow},
+ {"⇧", "⇧", 1, Mod, Shift},
+ {"", "", 2, Pad },
+ { ":", ":", 1, Code, KEY_SEMICOLON, 0, Shift },
+ { ";", ";", 1, Code, KEY_SEMICOLON, 0},
+ { "!", "!", 1, Code, KEY_1, 0, Shift},
+ { "?", "?", 1, Code, KEY_DOT, 0, Shift},
+ { ",", ",", 1, Code, KEY_COMMA},
+ {"", "", 2, Pad },
+ {"", "", 0.0, EndRow},
+ {"Abc", "Abc", 1.0, Layout, 0, &layouts[(DefaultLayout == Simple) ? Special : Cyrillic], .scheme=1 },
+ {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme=1},
+ {",", "'", 1.0, Code, KEY_COMMA, &layouts[ComposeMath]},
+ {"", "", 4.0, Code, KEY_SPACE},
+ {".", "?", 1.0, Code, KEY_DOT, &layouts[ComposePunctuation]},
+ {"Enter", "Enter", 2.0, Code, KEY_ENTER, .scheme=1},
+ {"", "", 0.0, Last},
+};
+
+static struct key keys_compose_bracket[] = {
+ {"", "", 5, Pad },
+ { "{", "{", 1, Code, KEY_LEFTBRACE, 0, Shift},
+ { "}", "}", 1, Code, KEY_RIGHTBRACE, 0, Shift},
+ { "[", "[", 1, Code, KEY_LEFTBRACE},
+ { "]", "]", 1, Code, KEY_RIGHTBRACE },
+ {"", "", 0, EndRow},
+ {"", "", 5, Pad },
+ { "<", "<", 1, Code, KEY_COMMA, 0, AltGr },
+ { ">", ">", 1, Code, KEY_SLASH, 0, Shift },
+ { "`", "`", 1, Code, KEY_GRAVE},
+ { "\"", "\"", 1, Code, KEY_APOSTROPHE, 0, Shift },
+ { "'", "'", 1, Code, KEY_APOSTROPHE },
+ {"", "", 0.0, EndRow},
+ {"⇧", "⇧", 1, Mod, Shift},
+ {"", "", 9, Pad },
+ {"", "", 0.0, EndRow},
+ {"Abc", "Abc", 1.0, Layout, 0, &layouts[(DefaultLayout == Simple) ? Special : Cyrillic], .scheme=1 },
+ {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme=1},
+ {",", "'", 1.0, Code, KEY_COMMA, &layouts[ComposeMath]},
+ {"", "", 4.0, Code, KEY_SPACE},
+ {".", "?", 1.0, Code, KEY_DOT, &layouts[ComposePunctuation]},
+ {"Enter", "Enter", 2.0, Code, KEY_ENTER, .scheme=1},
+ {"", "", 0.0, Last},
+};