Made 'full' and 'simple' layouts less prone to mistyping and improved layout switching

- The full layout now squashes less keys in a row, to accomplish this
  the semicolon/colon, equal/plus and alt keys had to be sacrificed
  from the full layout (they're on the special/symbols layout still).
- The half-keys in the simple layout are removed, giving a bit more
  space.
- The default total keyboard height has been slightly enlarged (10px)
- The compose key moved down, it was too close to the 'a' (accidental
  presses). The tab key moved to the top-right.
- The spacing between the buttons is slightly larger (aesthetic only)
- The key for layer switching is now labelled more consistently with an icon, and indicates direction of switching with an arrow
- An extra "index" layout was added that can be activated by pressing
  Compose + the next/prev layout button. It has a key for each layout,
  even those not specified at start. This special layout does not appear
  in the normal layer cycling.
- The "Abc" key on secondary layers returns to the last alphabetical layout
- The compose layouts automatically hide when the user presses the space
  where there are no keys, no need to explicitly press the "Abc" key.
This commit is contained in:
Maarten van Gompel 2023-08-25 15:58:35 +02:00
parent b6ec34fe3a
commit 2e476c6548
5 changed files with 204 additions and 120 deletions

View File

@ -17,7 +17,7 @@ new features.
- Custom color schemes - Custom color schemes
- Proper font drawing - Proper font drawing
- Intuitive layouts - Intuitive layouts
- International layouts (cyrillic, arabic) - International layouts (cyrillic, arabic, persian, greek, georgian)
- Support for 'Copy' keys which are not on the keymap - Support for 'Copy' keys which are not on the keymap
- Emoji support - Emoji support
- Compose key for character variants (e.g. diacritics) - Compose key for character variants (e.g. diacritics)
@ -55,7 +55,7 @@ the resulting binary will be `wvkbd-yourlayout`
Run `wvkbd-mobintl` (or the binary for your custom layout set). Run `wvkbd-mobintl` (or the binary for your custom layout set).
You can switch between the layouts/layers of the keyboard by pressing the Abc/Sym key in the bottom-left. If you only You can switch between the layouts/layers of the keyboard by pressing the little keyboard key in the bottom-left. If you only
want a subset of the available layers, you can define which wants you want and in what order you want to cycle through want a subset of the available layers, you can define which wants you want and in what order you want to cycle through
them using the `-l` parameter. This takes takes a ordered comma separated list of them using the `-l` parameter. This takes takes a ordered comma separated list of
layout names that are defined in your layout set. layout names that are defined in your layout set.

View File

@ -1,5 +1,6 @@
#include "proto/virtual-keyboard-unstable-v1-client-protocol.h" #include "proto/virtual-keyboard-unstable-v1-client-protocol.h"
#include <linux/input-event-codes.h> #include <linux/input-event-codes.h>
#include <stddef.h>
#include <stdio.h> #include <stdio.h>
#include <sys/mman.h> #include <sys/mman.h>
#include "keyboard.h" #include "keyboard.h"
@ -19,11 +20,16 @@
#include KEYMAP #include KEYMAP
void void
kbd_switch_layout(struct kbd *kb, struct layout *l) { kbd_switch_layout(struct kbd *kb, struct layout *l, size_t layer_index) {
kb->prevlayout = kb->layout; kb->prevlayout = kb->layout;
if ((kb->layer_index != kb->last_abc_index) && (kb->layout->abc)) {
kb->last_abc_layout = kb->layout;
kb->last_abc_index = kb->layer_index;
}
kb->layer_index = layer_index;
kb->layout = l; kb->layout = l;
if (kb->debug) if (kb->debug)
fprintf(stderr, "Switching to layout %s)\n", kb->layout->name); fprintf(stderr, "Switching to layout %s, layer_index %ld\n", kb->layout->name, layer_index);
if ((!kb->prevlayout) || if ((!kb->prevlayout) ||
(strcmp(kb->prevlayout->keymap_name, kb->layout->keymap_name) != 0)) { (strcmp(kb->prevlayout->keymap_name, kb->layout->keymap_name) != 0)) {
fprintf(stderr, "Switching to keymap %s\n", kb->layout->keymap_name); fprintf(stderr, "Switching to keymap %s\n", kb->layout->keymap_name);
@ -98,6 +104,7 @@ kbd_init(struct kbd *kb, struct layout *layouts,
fprintf(stderr, "Found %d layouts\n", i); fprintf(stderr, "Found %d layouts\n", i);
kb->layer_index = 0; kb->layer_index = 0;
kb->last_abc_index = 0;
if (layer_names_list) if (layer_names_list)
kb->layers = kbd_init_layers(layer_names_list); kb->layers = kbd_init_layers(layer_names_list);
@ -119,7 +126,7 @@ kbd_init(struct kbd *kb, struct layout *layouts,
} }
kb->layout = &kb->layouts[layer]; kb->layout = &kb->layouts[layer];
kb->prevlayout = kb->layout; kb->last_abc_layout = &kb->layouts[layer];
/* upload keymap */ /* upload keymap */
create_and_upload_keymap(kb, kb->layout->keymap_name, 0, 0); create_and_upload_keymap(kb, kb->layout->keymap_name, 0, 0);
@ -183,6 +190,16 @@ kbd_get_key(struct kbd *kb, uint32_t x, uint32_t y) {
return NULL; return NULL;
} }
size_t
kbd_get_layer_index(struct kbd *kb, struct layout *l) {
for (size_t i = 0; i < NumLayouts - 1; i++) {
if (l == &kb->layouts[i]) {
return i;
}
}
return 0;
}
void void
kbd_unpress_key(struct kbd *kb, uint32_t time) { kbd_unpress_key(struct kbd *kb, uint32_t time) {
bool unlatch_shift = false; bool unlatch_shift = false;
@ -205,7 +222,7 @@ kbd_unpress_key(struct kbd *kb, uint32_t time) {
if (kb->compose >= 2) { if (kb->compose >= 2) {
kb->compose = 0; kb->compose = 0;
kbd_switch_layout(kb, kb->prevlayout); kbd_switch_layout(kb, kb->prevlayout, kb->last_abc_index);
} else if (unlatch_shift) { } else if (unlatch_shift) {
kbd_draw_layout(kb); kbd_draw_layout(kb);
} else { } else {
@ -257,13 +274,22 @@ kbd_motion_key(struct kbd *kb, uint32_t time, uint32_t x, uint32_t y) {
void void
kbd_press_key(struct kbd *kb, struct key *k, uint32_t time) { kbd_press_key(struct kbd *kb, struct key *k, uint32_t time) {
if ((kb->compose == 1) && (k->type != Compose) && (k->type != Mod) && if ((kb->compose == 1) && (k->type != Compose) && (k->type != Mod)) {
(k->type != NextLayer) && (k->layout)) { if ((k->type == NextLayer) || (k->type == BackLayer) || ((k->type == Code) && (k->code == KEY_SPACE))) {
kb->compose = 0;
if (kb->debug)
fprintf(stderr, "showing layout index\n");
kbd_switch_layout(kb, &kb->layouts[Index], 0);
return;
} else if (k->layout) {
kb->compose++; kb->compose++;
if (kb->debug) if (kb->debug)
fprintf(stderr, "showing compose %d\n", kb->compose); fprintf(stderr, "showing compose %d\n", kb->compose);
kbd_switch_layout(kb, k->layout); kbd_switch_layout(kb, k->layout, kbd_get_layer_index(kb, k->layout));
return; return;
} else {
return;
}
} }
switch (k->type) { switch (k->type) {
@ -304,7 +330,14 @@ kbd_press_key(struct kbd *kb, struct key *k, uint32_t time) {
break; break;
case Layout: case Layout:
// switch to the layout determined by the key // switch to the layout determined by the key
kbd_switch_layout(kb, k->layout); kbd_switch_layout(kb, k->layout, kbd_get_layer_index(kb, k->layout));
//reset previous layout to default/first so we don't get any weird cycles
kb->last_abc_index = 0;
if (kb->landscape) {
kb->last_abc_layout = &kb->layouts[kb->landscape_layers[0]];
} else {
kb->last_abc_layout = &kb->layouts[kb->layers[0]];
}
break; break;
case Compose: case Compose:
// switch to the associated layout determined by the *next* keypress // switch to the associated layout determined by the *next* keypress
@ -319,15 +352,16 @@ kbd_press_key(struct kbd *kb, struct key *k, uint32_t time) {
kbd_draw_key(kb, k, Unpress); kbd_draw_key(kb, k, Unpress);
} }
break; break;
case NextLayer: case NextLayer: //(also handles previous layer when shift modifier is on, or "first layer" with other modifiers)
size_t layer_index = kb->layer_index;
if ((kb->mods & Ctrl) || (kb->mods & Alt) || (kb->mods & AltGr) || ((bool)kb->compose)) { if ((kb->mods & Ctrl) || (kb->mods & Alt) || (kb->mods & AltGr) || ((bool)kb->compose)) {
// with modifiers: switch to the first layer // with modifiers: switch to the first layer
kb->layer_index = 0; layer_index = 0;
kb->mods = 0; kb->mods = 0;
} else if ((kb->mods & Shift) || (kb->mods & CapsLock)) { } else if ((kb->mods & Shift) || (kb->mods & CapsLock)) {
// with modifiers: switch to the previous layout in the layer sequence // with modifiers: switch to the previous layout in the layer sequence
if (kb->layer_index > 0) { if (layer_index > 0) {
kb->layer_index--; layer_index--;
} else { } else {
size_t layercount = 0; size_t layercount = 0;
for (size_t i = 0; layercount == 0; i++) { for (size_t i = 0; layercount == 0; i++) {
@ -337,37 +371,46 @@ kbd_press_key(struct kbd *kb, struct key *k, uint32_t time) {
if (kb->layers[i] == NumLayouts) layercount = i; if (kb->layers[i] == NumLayouts) layercount = i;
} }
} }
kb->layer_index = layercount - 1; layer_index = layercount - 1;
} }
kb->mods = 0; kb->mods = 0;
} else { } else {
// normal behaviour: switch to the next layout in the layer sequence // normal behaviour: switch to the next layout in the layer sequence
kb->layer_index++; layer_index++;
} }
enum layout_id layer; enum layout_id layer;
if (kb->landscape) { if (kb->landscape) {
layer = kb->landscape_layers[kb->layer_index]; layer = kb->landscape_layers[layer_index];
} else { } else {
layer = kb->layers[kb->layer_index]; layer = kb->layers[layer_index];
} }
if (layer == NumLayouts) { if (layer == NumLayouts) {
kb->layer_index = 0; layer_index = 0;
if (kb->landscape) { if (kb->landscape) {
layer = kb->landscape_layers[kb->layer_index]; layer = kb->landscape_layers[layer_index];
} else { } else {
layer = kb->layers[kb->layer_index]; layer = kb->layers[layer_index];
} }
} }
if ((bool)kb->compose) { if ((bool)kb->compose) {
kb->compose = 0; kb->compose = 0;
kbd_draw_key(kb, k, Unpress); kbd_draw_key(kb, k, Unpress);
} }
kbd_switch_layout(kb, &kb->layouts[layer]); kbd_switch_layout(kb, &kb->layouts[layer], layer_index);
break; break;
case BackLayer: case BackLayer: //triggered when "Abc" keys are pressed
// switch to the previously active layout // switch to the last active alphabetical layout
if (kb->prevlayout) if (kb->last_abc_layout) {
kbd_switch_layout(kb, kb->prevlayout); kb->compose = 0;
kbd_switch_layout(kb, kb->last_abc_layout, kb->last_abc_index);
//reset previous layout to default/first so we don't get any weird cycles
kb->last_abc_index = 0;
if (kb->landscape) {
kb->last_abc_layout = &kb->layouts[kb->landscape_layers[0]];
} else {
kb->last_abc_layout = &kb->layouts[kb->layers[0]];
}
}
break; break;
case Copy: case Copy:
// copy code as unicode chr by setting a temporary keymap // copy code as unicode chr by setting a temporary keymap
@ -455,7 +498,7 @@ kbd_draw_layout(struct kbd *kb) {
struct drwsurf *d = kb->surf; struct drwsurf *d = kb->surf;
struct key *next_key = kb->layout->keys; struct key *next_key = kb->layout->keys;
if (kb->debug) if (kb->debug)
fprintf(stderr, "Draw layout"); fprintf(stderr, "Draw layout\n");
drw_fill_rectangle(d, kb->scheme.bg, 0, 0, kb->w, kb->h); drw_fill_rectangle(d, kb->scheme.bg, 0, 0, kb->w, kb->h);
@ -483,6 +526,12 @@ kbd_resize(struct kbd *kb, struct layout *layouts, uint8_t layoutcount) {
drwsurf_resize(d, kb->w, kb->h, kb->scale); drwsurf_resize(d, kb->w, kb->h, kb->scale);
for (int i = 0; i < layoutcount; i++) { for (int i = 0; i < layoutcount; i++) {
if (kb->debug) {
if (layouts[i].name)
fprintf(stderr, "Initialising layout %s\n", layouts[i].name);
else
fprintf(stderr, "Initialising unnamed layout %d\n", i);
}
kbd_init_layout(&layouts[i], kb->w, kb->h); kbd_init_layout(&layouts[i], kb->w, kb->h);
} }
kbd_draw_layout(kb); kbd_draw_layout(kb);

View File

@ -81,6 +81,7 @@ struct layout {
struct key *keys; struct key *keys;
const char *keymap_name; const char *keymap_name;
const char *name; const char *name;
bool abc; //is this an alphabetical/abjad layout or not? (i.e. something that is a primary input layout)
uint32_t keyheight; // absolute height (pixels) uint32_t keyheight; // absolute height (pixels)
}; };
@ -99,8 +100,10 @@ struct kbd {
uint8_t compose; uint8_t compose;
struct key *last_press; struct key *last_press;
struct key *last_swipe; struct key *last_swipe;
struct layout *prevlayout; struct layout *prevlayout; //the previous layout, needed to keep track of keymap changes
size_t layer_index; size_t layer_index;
struct layout *last_abc_layout; //the last alphabetical layout to fall back to (may be further away than prevlayout)
size_t last_abc_index; //the layer index of the last alphabetical layout
struct layout *layouts; struct layout *layouts;
enum layout_id *layers; enum layout_id *layers;
@ -119,6 +122,7 @@ void kbd_init(struct kbd *kb, struct layout *layouts,
char *layer_names_list, char *landscape_layer_names_list); char *layer_names_list, char *landscape_layer_names_list);
void kbd_init_layout(struct layout *l, uint32_t width, uint32_t height); void kbd_init_layout(struct layout *l, uint32_t width, uint32_t height);
struct key *kbd_get_key(struct kbd *kb, uint32_t x, uint32_t y); struct key *kbd_get_key(struct kbd *kb, uint32_t x, uint32_t y);
size_t kbd_get_layer_index(struct kbd *kb, struct layout *l);
void kbd_unpress_key(struct kbd *kb, uint32_t time); void kbd_unpress_key(struct kbd *kb, uint32_t time);
void kbd_release_key(struct kbd *kb, uint32_t time); void kbd_release_key(struct kbd *kb, uint32_t time);
void kbd_motion_key(struct kbd *kb, uint32_t time, uint32_t x, uint32_t y); void kbd_motion_key(struct kbd *kb, uint32_t time, uint32_t x, uint32_t y);
@ -129,7 +133,7 @@ void kbd_draw_layout(struct kbd *kb);
void kbd_resize(struct kbd *kb, struct layout *layouts, uint8_t layoutcount); void kbd_resize(struct kbd *kb, struct layout *layouts, uint8_t layoutcount);
uint8_t kbd_get_rows(struct layout *l); uint8_t kbd_get_rows(struct layout *l);
double kbd_get_row_length(struct key *k); double kbd_get_row_length(struct key *k);
void kbd_switch_layout(struct kbd *kb, struct layout *l); void kbd_switch_layout(struct kbd *kb, struct layout *l, size_t layer_index);
void create_and_upload_keymap(struct kbd *kb, const char *name, void create_and_upload_keymap(struct kbd *kb, const char *name,
uint32_t comp_unichr, uint32_t comp_shift_unichr); uint32_t comp_unichr, uint32_t comp_shift_unichr);

View File

@ -1,12 +1,12 @@
/* constants */ /* constants */
/* how tall the keyboard should be by default (can be overriden) */ /* how tall the keyboard should be by default (can be overriden) */
#define KBD_PIXEL_HEIGHT 240 #define KBD_PIXEL_HEIGHT 250
/* how tall the keyboard should be by default (can be overriden) */ /* how tall the keyboard should be by default (can be overriden) */
#define KBD_PIXEL_LANDSCAPE_HEIGHT 120 #define KBD_PIXEL_LANDSCAPE_HEIGHT 120
/* spacing around each key */ /* spacing around each key */
#define KBD_KEY_BORDER 1 #define KBD_KEY_BORDER 2
/* layout declarations */ /* layout declarations */
enum layout_id { enum layout_id {
@ -55,13 +55,14 @@ enum layout_id {
ComposeCyrI, ComposeCyrI,
ComposeCyrJ, ComposeCyrJ,
ComposeCyrE, ComposeCyrE,
ComposeCyrU,
ComposeCyrL, ComposeCyrL,
ComposeCyrU,
ComposeCyrN, ComposeCyrN,
ComposeCyrTse, ComposeCyrTse,
ComposeCyrChe, ComposeCyrChe,
ComposeCyrG, ComposeCyrG,
ComposeCyrK, ComposeCyrK,
Index,
NumLayouts, NumLayouts,
}; };
@ -78,24 +79,25 @@ static struct key keys_full[], keys_special[], keys_specialpad[], keys_simple[],
keys_compose_cyr_i[], keys_compose_cyr_j[], keys_compose_cyr_e[], keys_compose_cyr_i[], keys_compose_cyr_j[], keys_compose_cyr_e[],
keys_compose_cyr_u[], keys_compose_cyr_l[], keys_compose_cyr_n[], keys_compose_cyr_u[], keys_compose_cyr_l[], keys_compose_cyr_n[],
keys_compose_cyr_tse[], keys_compose_cyr_che[], keys_compose_cyr_g[], keys_compose_cyr_tse[], keys_compose_cyr_che[], keys_compose_cyr_g[],
keys_compose_cyr_k[], keys_dialer[]; keys_compose_cyr_k[], keys_dialer[], keys_index[];
static struct layout layouts[NumLayouts] = { static struct layout layouts[NumLayouts] = {
[Full] = {keys_full, "latin", "full"}, // second parameter is the keymap name [Full] = {keys_full, "latin", "full", true}, // second parameter is the keymap name
// third parameter is the layout name // third parameter is the layout name
[Special] = {keys_special, "latin", "special"}, // last parameter indicates if it's an alphabetical/primary layout
[SpecialPad] = {keys_specialpad, "latin", "specialpad"}, [Special] = {keys_special, "latin", "special", false},
[Simple] = {keys_simple, "latin", "simple"}, [SpecialPad] = {keys_specialpad, "latin", "specialpad", false},
[SimpleGrid] = {keys_simplegrid, "latin", "simplegrid"}, [Simple] = {keys_simple, "latin", "simple", true},
[Cyrillic] = {keys_cyrillic, "cyrillic", "cyrillic"}, [SimpleGrid] = {keys_simplegrid, "latin", "simplegrid", true},
[Dialer] = {keys_dialer, "latin", "dialer"}, [Cyrillic] = {keys_cyrillic, "cyrillic", "cyrillic", true},
[Arabic] = {keys_arabic, "arabic", "arabic"}, [Dialer] = {keys_dialer, "latin", "dialer", false},
[Georgian] = {keys_georgian, "georgian", "georgian"}, [Arabic] = {keys_arabic, "arabic", "arabic", true},
[Persian] = {keys_persian, "persian", "persian"}, [Georgian] = {keys_georgian, "georgian", "georgian", true},
[Greek] = {keys_greek, "greek", "greek"}, [Persian] = {keys_persian, "persian", "persian", true},
[Emoji] = {keys_emoji, "latin", "emoji"}, [Greek] = {keys_greek, "greek", "greek", true},
[Nav] = {keys_nav, "latin", "nav"}, [Emoji] = {keys_emoji, "latin", "emoji", false},
[Landscape] = {keys_landscape, "latin", "landscape"}, [Nav] = {keys_nav, "latin", "nav", false},
[Landscape] = {keys_landscape, "latin", "landscape", true},
[ComposeA] = {keys_compose_a, "latin"}, [ComposeA] = {keys_compose_a, "latin"},
[ComposeE] = {keys_compose_e, "latin"}, [ComposeE] = {keys_compose_e, "latin"},
[ComposeY] = {keys_compose_y, "latin"}, [ComposeY] = {keys_compose_y, "latin"},
@ -134,6 +136,8 @@ static struct layout layouts[NumLayouts] = {
[ComposeCyrChe] = {keys_compose_cyr_che, "cyrillic"}, [ComposeCyrChe] = {keys_compose_cyr_che, "cyrillic"},
[ComposeCyrG] = {keys_compose_cyr_g, "cyrillic"}, [ComposeCyrG] = {keys_compose_cyr_g, "cyrillic"},
[ComposeCyrK] = {keys_compose_cyr_k, "cyrillic"}, [ComposeCyrK] = {keys_compose_cyr_k, "cyrillic"},
[Index] = {keys_index,"latin","index", false},
}; };
/* key layouts /* key layouts
@ -167,14 +171,14 @@ static struct layout layouts[NumLayouts] = {
static struct key keys_full[] = { static struct key keys_full[] = {
{"Esc", "Esc", 1.0, Code, KEY_ESC, .scheme = 1}, {"Esc", "Esc", 1.0, Code, KEY_ESC, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{"Tab", "Tab", 1.0, Code, KEY_TAB, .scheme = 1},
{"", "", 1.0, Code, KEY_UP, .scheme = 1}, {"", "", 1.0, Code, KEY_UP, .scheme = 1},
{"", "", 1.0, Code, KEY_DOWN, .scheme = 1}, {"", "", 1.0, Code, KEY_DOWN, .scheme = 1},
{"", "", 1.0, Code, KEY_LEFT, .scheme = 1}, {"", "", 1.0, Code, KEY_LEFT, .scheme = 1},
{"", "", 1.0, Code, KEY_RIGHT, .scheme = 1}, {"", "", 1.0, Code, KEY_RIGHT, .scheme = 1},
{"'", "\"", 1.0, Code, KEY_APOSTROPHE, .scheme = 1}, {"'", "\"", 1.0, Code, KEY_APOSTROPHE },
{";", ":", 1.0, Code, KEY_SEMICOLON, .scheme = 1}, {"-", "_", 1.0, Code, KEY_MINUS },
{"/", ">", 1.0, Code, KEY_SLASH, .scheme = 1}, {"/", ">", 1.0, Code, KEY_SLASH },
{"Tab", "Tab", 1.0, Code, KEY_TAB, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"1", "!", 1.0, Code, KEY_1}, {"1", "!", 1.0, Code, KEY_1},
@ -187,11 +191,8 @@ static struct key keys_full[] = {
{"8", "*", 1.0, Code, KEY_8}, {"8", "*", 1.0, Code, KEY_8},
{"9", "(", 1.0, Code, KEY_9}, {"9", "(", 1.0, Code, KEY_9},
{"0", ")", 1.0, Code, KEY_0}, {"0", ")", 1.0, Code, KEY_0},
{"-", "_", 1.0, Code, KEY_MINUS},
{"=", "+", 1.0, Code, KEY_EQUAL},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"", "", 0.5, Pad},
{"q", "Q", 1.0, Code, KEY_Q, &layouts[Emoji]}, {"q", "Q", 1.0, Code, KEY_Q, &layouts[Emoji]},
{"w", "W", 1.0, Code, KEY_W, &layouts[ComposeW]}, {"w", "W", 1.0, Code, KEY_W, &layouts[ComposeW]},
{"e", "E", 1.0, Code, KEY_E, &layouts[ComposeE]}, {"e", "E", 1.0, Code, KEY_E, &layouts[ComposeE]},
@ -204,7 +205,7 @@ static struct key keys_full[] = {
{"p", "P", 1.0, Code, KEY_P, &layouts[ComposeP]}, {"p", "P", 1.0, Code, KEY_P, &layouts[ComposeP]},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Cmp", "Cmp", 1.0, Compose, .scheme = 1}, {"", "", 0.5, Pad},
{"a", "A", 1.0, Code, KEY_A, &layouts[ComposeA]}, {"a", "A", 1.0, Code, KEY_A, &layouts[ComposeA]},
{"s", "S", 1.0, Code, KEY_S, &layouts[ComposeS]}, {"s", "S", 1.0, Code, KEY_S, &layouts[ComposeS]},
{"d", "D", 1.0, Code, KEY_D, &layouts[ComposeD]}, {"d", "D", 1.0, Code, KEY_D, &layouts[ComposeD]},
@ -228,12 +229,12 @@ static struct key keys_full[] = {
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Sym", "Sym", 1.0, NextLayer, .scheme = 1}, {"⌨→", "←⌨", 1.5, NextLayer, .scheme = 1},
{"Alt", "Alt", 1.0, Mod, Alt, .scheme = 1}, {"Cmp", "Cmp", 1.0, Compose, .scheme = 1},
{",", "'", 1.0, Code, KEY_COMMA}, {",", "'", 1.0, Code, KEY_COMMA},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
{".", "?", 1.0, Code, KEY_DOT}, {".", "?", 1.0, Code, KEY_DOT},
{"Enter", "Enter", 2.0, Code, KEY_ENTER, .scheme = 1}, {"Enter", "Enter", 1.5, Code, KEY_ENTER, .scheme = 1},
/* end of layout */ /* end of layout */
{"", "", 0.0, Last}, {"", "", 0.0, Last},
@ -241,8 +242,7 @@ static struct key keys_full[] = {
static struct key keys_special[] = { static struct key keys_special[] = {
{"Esc", "Esc", 1.0, Code, KEY_ESC, .scheme = 1}, {"Esc", "Esc", 1.0, Code, KEY_ESC, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Alt", "Alt", 1.0, Mod, Alt, .scheme = 1},
{"Tab", "Tab", 1.0, Code, KEY_TAB, .scheme = 1},
{"", "", 1.0, Code, KEY_UP, .scheme = 1}, {"", "", 1.0, Code, KEY_UP, .scheme = 1},
{"", "", 1.0, Code, KEY_DOWN, .scheme = 1}, {"", "", 1.0, Code, KEY_DOWN, .scheme = 1},
{"", "", 1.0, Code, KEY_LEFT, .scheme = 1}, {"", "", 1.0, Code, KEY_LEFT, .scheme = 1},
@ -265,7 +265,7 @@ static struct key keys_special[] = {
{"0", ")", 1.0, Code, KEY_0}, {"0", ")", 1.0, Code, KEY_0},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Caps", "Caps", 1.0, Mod, CapsLock, .scheme = 1}, {"CpL", "CpL", 1.0, Mod, CapsLock, .scheme = 1},
{"Sup", "Sup", 1.0, Mod, Super, .scheme = 1}, {"Sup", "Sup", 1.0, Mod, Super, .scheme = 1},
{"`", "~", 1.0, Code, KEY_GRAVE}, {"`", "~", 1.0, Code, KEY_GRAVE},
{"'", "\"", 1.0, Code, KEY_APOSTROPHE}, {"'", "\"", 1.0, Code, KEY_APOSTROPHE},
@ -288,8 +288,8 @@ static struct key keys_special[] = {
{"", "", 1.0, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.0, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, NextLayer, .scheme = 1}, {"Abc", "Abc", 1.0, BackLayer, .scheme = 1},
{"Alt", "Alt", 1.0, Mod, Alt, .scheme = 1}, {"⌨→", "←⌨", 1.0, NextLayer, .scheme = 1},
{",", "'", 1.0, Code, KEY_COMMA}, {",", "'", 1.0, Code, KEY_COMMA},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
{".", "?", 1.0, Code, KEY_DOT}, {".", "?", 1.0, Code, KEY_DOT},
@ -335,7 +335,7 @@ static struct key keys_specialpad[] = {
{"", "", 1.0, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.0, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, NextLayer, .scheme = 1}, {"⌨→", "←⌨", 1.0, NextLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{"Alt", "Alt", 1.0, Mod, Alt, .scheme = 1}, {"Alt", "Alt", 1.0, Mod, Alt, .scheme = 1},
{"Sup", "Sup", 1.0, Mod, Super, .scheme = 1}, {"Sup", "Sup", 1.0, Mod, Super, .scheme = 1},
@ -352,7 +352,6 @@ static struct key keys_specialpad[] = {
}; };
static struct key keys_simple[] = { static struct key keys_simple[] = {
{"", "", 0.5, Code, KEY_TAB, .scheme = 1},
{"q", "Q", 1.0, Code, KEY_Q, &layouts[Emoji]}, {"q", "Q", 1.0, Code, KEY_Q, &layouts[Emoji]},
{"w", "W", 1.0, Code, KEY_W, &layouts[ComposeW]}, {"w", "W", 1.0, Code, KEY_W, &layouts[ComposeW]},
{"e", "E", 1.0, Code, KEY_E, &layouts[ComposeE]}, {"e", "E", 1.0, Code, KEY_E, &layouts[ComposeE]},
@ -365,7 +364,7 @@ static struct key keys_simple[] = {
{"p", "P", 1.0, Code, KEY_P, &layouts[ComposeP]}, {"p", "P", 1.0, Code, KEY_P, &layouts[ComposeP]},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Cmp", "Cmp", 1.0, Compose, .scheme = 1}, {"", "", 0.5, Pad},
{"a", "A", 1.0, Code, KEY_A, &layouts[ComposeA]}, {"a", "A", 1.0, Code, KEY_A, &layouts[ComposeA]},
{"s", "S", 1.0, Code, KEY_S, &layouts[ComposeS]}, {"s", "S", 1.0, Code, KEY_S, &layouts[ComposeS]},
{"d", "D", 1.0, Code, KEY_D, &layouts[ComposeD]}, {"d", "D", 1.0, Code, KEY_D, &layouts[ComposeD]},
@ -375,7 +374,7 @@ static struct key keys_simple[] = {
{"j", "J", 1.0, Code, KEY_J, &layouts[ComposeJ]}, {"j", "J", 1.0, Code, KEY_J, &layouts[ComposeJ]},
{"k", "K", 1.0, Code, KEY_K, &layouts[ComposeK]}, {"k", "K", 1.0, Code, KEY_K, &layouts[ComposeK]},
{"l", "L", 1.0, Code, KEY_L, &layouts[ComposeL]}, {"l", "L", 1.0, Code, KEY_L, &layouts[ComposeL]},
{"'", "\"", 0.5, Code, KEY_APOSTROPHE, &layouts[ComposeBracket]}, {"", "", 0.5, Pad},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"", "", 1.5, Mod, Shift, .scheme = 1}, {"", "", 1.5, Mod, Shift, .scheme = 1},
@ -389,13 +388,14 @@ static struct key keys_simple[] = {
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, NextLayer, .scheme = 1}, {"⌨→", "←⌨", 1.0, NextLayer, .scheme = 1},
{"Cmp", "Cmp", 1.0, Compose, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_COMMA, &layouts[ComposeMath]}, {"-", "_", 0.75, Code, KEY_MINUS, &layouts[ComposeMath]},
{"-", "_", 1.0, Code, KEY_MINUS, &layouts[ComposeMath]}, {",", "'", 0.75, Code, KEY_COMMA, &layouts[ComposeMath]},
{"", "", 3.0, Code, KEY_SPACE}, {"", "", 3.0, Code, KEY_SPACE},
{".", "?", 1.0, Code, KEY_DOT, &layouts[ComposePunctuation]}, {".", "?", 1.0, Code, KEY_DOT, &layouts[ComposePunctuation]},
{"Enter", "Enter", 2.0, Code, KEY_ENTER, .scheme = 1}, {"Enter", "Enter", 1.5, Code, KEY_ENTER, .scheme = 1},
/* end of layout */ /* end of layout */
{"", "", 0.0, Last}, {"", "", 0.0, Last},
@ -422,7 +422,7 @@ static struct key keys_dialer[] = {
{"0", "0", 1.0, Code, KEY_0}, {"0", "0", 1.0, Code, KEY_0},
{"#", "#", 1.0, Code, KEY_3, 0, Shift}, {"#", "#", 1.0, Code, KEY_3, 0, Shift},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, NextLayer, .scheme = 1}, {"⌨→", "←⌨", 1.0, NextLayer, .scheme = 1},
{"Enter", "Enter", 2.0, Code, KEY_ENTER, .scheme = 1}, {"Enter", "Enter", 2.0, Code, KEY_ENTER, .scheme = 1},
/* end of layout */ /* end of layout */
@ -466,7 +466,7 @@ static struct key keys_simplegrid[] = {
{"", "", 1.0, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.0, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, NextLayer, .scheme = 1}, {"⌨→", "←⌨", 1.0, NextLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{"-", "_", 1.0, Code, KEY_MINUS, &layouts[ComposeMath]}, {"-", "_", 1.0, Code, KEY_MINUS, &layouts[ComposeMath]},
{"Cmp", "Cmp", 1.0, Compose, .scheme = 1}, {"Cmp", "Cmp", 1.0, Compose, .scheme = 1},
@ -533,7 +533,7 @@ static struct key keys_cyrillic[] = {
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, NextLayer, .scheme = 1}, {"⌨→", "←⌨", 1.0, NextLayer, .scheme = 1},
{"Cmp", "Cmp", 1.0, Compose, .scheme = 1}, {"Cmp", "Cmp", 1.0, Compose, .scheme = 1},
{",", "'", 1.0, Code, KEY_EQUAL}, {",", "'", 1.0, Code, KEY_EQUAL},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -597,7 +597,7 @@ static struct key keys_arabic[] = {
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, NextLayer, .scheme = 1}, {"⌨→", "←⌨", 1.0, NextLayer, .scheme = 1},
{"", "", 1.0, Mod, Shift, .scheme = 1}, {"", "", 1.0, Mod, Shift, .scheme = 1},
{"Cmp", "Cmp", 1.0, Compose, .scheme = 1}, {"Cmp", "Cmp", 1.0, Compose, .scheme = 1},
{"", "", 5.0, Code, KEY_SPACE}, {"", "", 5.0, Code, KEY_SPACE},
@ -657,7 +657,7 @@ static struct key keys_georgian[] = {
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, NextLayer, .scheme = 1}, {"⌨→", "←⌨", 1.0, NextLayer, .scheme = 1},
{"", "", 1.0, Mod, Shift, .scheme = 1}, {"", "", 1.0, Mod, Shift, .scheme = 1},
{"Cmp", "Cmp", 1.0, Compose, .scheme = 1}, {"Cmp", "Cmp", 1.0, Compose, .scheme = 1},
{"", "", 5.0, Code, KEY_SPACE}, {"", "", 5.0, Code, KEY_SPACE},
@ -722,7 +722,7 @@ static struct key keys_persian[] = {
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, NextLayer, .scheme = 1}, {"⌨→", "←⌨", 1.0, NextLayer, .scheme = 1},
{"Cmp", "Cmp", 1.0, Compose, .scheme = 1}, {"Cmp", "Cmp", 1.0, Compose, .scheme = 1},
{".", "،", 1.0, Code, KEY_DOT}, {".", "،", 1.0, Code, KEY_DOT},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -785,7 +785,7 @@ static struct key keys_greek[] = {
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.5, NextLayer, .scheme = 1}, {"⌨→", "←⌨", 1.5, NextLayer, .scheme = 1},
{",", "'", 1.0, Code, KEY_COMMA}, {",", "'", 1.0, Code, KEY_COMMA},
{"", "", 5, Code, KEY_SPACE}, {"", "", 5, Code, KEY_SPACE},
{".", "\"", 1.0, Code, KEY_DOT}, {".", "\"", 1.0, Code, KEY_DOT},
@ -993,6 +993,7 @@ static struct key keys_emoji[] = {
{"", "", 1.0, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.0, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer, .scheme = 1}, {"Abc", "Abc", 1.0, BackLayer, .scheme = 1},
{"⌨→", "←⌨", 1.0, NextLayer, .scheme = 1},
{"👆", "👊", 1.0, Copy, 0x1f446, 0, 0x1f44a}, {"👆", "👊", 1.0, Copy, 0x1f446, 0, 0x1f44a},
{"👇", "👌", 1.0, Copy, 0x1f447, 0, 0x1f44c}, {"👇", "👌", 1.0, Copy, 0x1f447, 0, 0x1f44c},
{"👈", "👏", 1.0, Copy, 0x1f448, 0, 0x1f44f}, {"👈", "👏", 1.0, Copy, 0x1f448, 0, 0x1f44f},
@ -1000,7 +1001,7 @@ static struct key keys_emoji[] = {
{"👋", "🙌", 1.0, Copy, 0x1f44b, 0, 0x1f64c}, {"👋", "🙌", 1.0, Copy, 0x1f44b, 0, 0x1f64c},
{"👍", "", 1.0, Copy, 0x1f44d, 0, 0x2705}, {"👍", "", 1.0, Copy, 0x1f44d, 0, 0x2705},
{"👎", "💪", 1.0, Copy, 0x1f44e, 0, 0x1f4aa}, {"👎", "💪", 1.0, Copy, 0x1f44e, 0, 0x1f4aa},
{"Enter", "Enter", 2.0, Code, KEY_ENTER, .scheme = 1}, {"Enter", "Enter", 1.0, Code, KEY_ENTER, .scheme = 1},
{"", "", 0.0, Last}, {"", "", 0.0, Last},
}; };
@ -1017,13 +1018,35 @@ static struct key keys_nav[] = {
{"", "", 1.0, Code, KEY_RIGHT, .scheme = 1}, {"", "", 1.0, Code, KEY_RIGHT, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Sym", "Sym", 1.0, NextLayer, .scheme = 1}, {"⌨→", "←⌨", 1.0, NextLayer, .scheme = 1},
{"", "", 1.0, Code, KEY_SPACE, .scheme = 1}, {"", "", 1.0, Code, KEY_SPACE, .scheme = 1},
{"", "", 1.0, Code, KEY_DOWN, .scheme = 1}, {"", "", 1.0, Code, KEY_DOWN, .scheme = 1},
{"", "", 1.0, Code, KEY_PAGEDOWN, .scheme = 1}, {"", "", 1.0, Code, KEY_PAGEDOWN, .scheme = 1},
{"", "", 0.0, Last}, {"", "", 0.0, Last},
}; };
static struct key keys_index[] = {
{"Full", "Full", 1.0, Layout, 0, &layouts[Full]},
{"Landscape", "Landscape", 1.5, Layout, 0, &layouts[Landscape]},
{"Simple", "Simple", 1.0, Layout, 0, &layouts[Simple]},
{"SimpleG", "SimpleG", 1.0, Layout, 0, &layouts[SimpleGrid]},
{"", "", 0.0, EndRow},
{"Symbols", "Symbols", 2.0, Layout, 0, &layouts[Special]},
{"SpecPad", "SpecPad", 1.5, Layout, 0, &layouts[SpecialPad]},
{"Nav", "Nav", 1.0, Layout, 0, &layouts[Nav]},
{"123", "123", 1.0, Layout, 0, &layouts[Dialer]},
{"🙂", "🙂", 1.0, Layout, 0, &layouts[Emoji]},
{"", "", 0.0, EndRow},
{"Абв", "Абв", 1.0, Layout, 0, &layouts[Cyrillic]},
{"αβγ", "αβγ", 1.0, Layout, 0, &layouts[Greek]},
{"ابج", "ابج", 1.0, Layout, 0, &layouts[Arabic]},
{"فر", "فر", 1.0, Layout, 0, &layouts[Persian]},
{"აბგ", "აბგ", 1.0, Layout, 0, &layouts[Georgian]},
{"", "", 0.0, Last},
};
static struct key keys_landscape[] = { static struct key keys_landscape[] = {
{"Esc", "Esc", 1.0, Code, KEY_ESC, .scheme = 1}, {"Esc", "Esc", 1.0, Code, KEY_ESC, .scheme = 1},
{"q", "Q", 1.0, Code, KEY_Q, &layouts[Emoji]}, {"q", "Q", 1.0, Code, KEY_Q, &layouts[Emoji]},
@ -1041,7 +1064,8 @@ static struct key keys_landscape[] = {
{"Tab", "Tab", 0.75, Code, KEY_TAB, .scheme = 1}, {"Tab", "Tab", 0.75, Code, KEY_TAB, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Cmp", "Cmp", 1.5, Compose, .scheme = 1}, {"AGr", "AGr", 1.0, Mod, AltGr, .scheme = 1},
{"", "", 0.5, Pad, .scheme = 1},
{"a", "A", 1.0, Code, KEY_A, &layouts[ComposeA]}, {"a", "A", 1.0, Code, KEY_A, &layouts[ComposeA]},
{"s", "S", 1.0, Code, KEY_S, &layouts[ComposeS]}, {"s", "S", 1.0, Code, KEY_S, &layouts[ComposeS]},
{"d", "D", 1.0, Code, KEY_D, &layouts[ComposeD]}, {"d", "D", 1.0, Code, KEY_D, &layouts[ComposeD]},
@ -1070,13 +1094,12 @@ static struct key keys_landscape[] = {
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Sym", "Sym", 1.0, NextLayer, .scheme = 1}, {"⌨→", "←⌨", 1.0, NextLayer, .scheme = 1},
{"Cmp", "Cmp", 1.0, Compose, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{"Alt", "Alt", 0.5, Mod, Alt, .scheme = 1},
{",", "'", 0.5, Code, KEY_COMMA, &layouts[ComposeMath]}, {",", "'", 0.5, Code, KEY_COMMA, &layouts[ComposeMath]},
{"", "", 3.0, Code, KEY_SPACE}, {"", "", 3.0, Code, KEY_SPACE},
{".", "?", 1.0, Code, KEY_DOT, &layouts[ComposeMath]}, {".", "?", 1.0, Code, KEY_DOT, &layouts[ComposeMath]},
{"Agr", "AGr", 1.0, Mod, AltGr, .scheme = 1},
{"Enter", "Enter", 2.0, Code, KEY_ENTER, .scheme = 1}, {"Enter", "Enter", 2.0, Code, KEY_ENTER, .scheme = 1},
/* end of layout */ /* end of layout */
@ -1092,7 +1115,7 @@ static struct key keys_compose_w[] = {
{"", "", 7, Pad}, {"", "", 7, Pad},
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Abc", "Abc", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_COMMA}, {",", "'", 1.0, Code, KEY_COMMA},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1114,7 +1137,7 @@ static struct key keys_compose_r[] = {
{"", "", 7, Pad}, {"", "", 7, Pad},
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Abc", "Abc", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_COMMA}, {",", "'", 1.0, Code, KEY_COMMA},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1138,7 +1161,7 @@ static struct key keys_compose_t[] = {
{"", "", 7, Pad}, {"", "", 7, Pad},
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Abc", "Abc", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_COMMA}, {",", "'", 1.0, Code, KEY_COMMA},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1157,7 +1180,7 @@ static struct key keys_compose_p[] = {
{"", "", 7, Pad}, {"", "", 7, Pad},
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Abc", "Abc", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_COMMA}, {",", "'", 1.0, Code, KEY_COMMA},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1182,7 +1205,7 @@ static struct key keys_compose_s[] = {
{"", "", 7, Pad}, {"", "", 7, Pad},
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Abc", "Abc", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_COMMA}, {",", "'", 1.0, Code, KEY_COMMA},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1204,7 +1227,7 @@ static struct key keys_compose_d[] = {
{"", "", 7, Pad}, {"", "", 7, Pad},
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Abc", "Abc", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_COMMA}, {",", "'", 1.0, Code, KEY_COMMA},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1223,7 +1246,7 @@ static struct key keys_compose_f[] = {
{"", "", 7, Pad}, {"", "", 7, Pad},
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Abc", "Abc", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_COMMA}, {",", "'", 1.0, Code, KEY_COMMA},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1244,7 +1267,7 @@ static struct key keys_compose_g[] = {
{"", "", 7, Pad}, {"", "", 7, Pad},
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Abc", "Abc", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_COMMA}, {",", "'", 1.0, Code, KEY_COMMA},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1265,7 +1288,7 @@ static struct key keys_compose_h[] = {
{"", "", 7, Pad}, {"", "", 7, Pad},
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Abc", "Abc", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_COMMA}, {",", "'", 1.0, Code, KEY_COMMA},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1284,7 +1307,7 @@ static struct key keys_compose_j[] = {
{"", "", 7, Pad}, {"", "", 7, Pad},
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Abc", "Abc", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_COMMA}, {",", "'", 1.0, Code, KEY_COMMA},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1305,7 +1328,7 @@ static struct key keys_compose_k[] = {
{"", "", 7, Pad}, {"", "", 7, Pad},
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Abc", "Abc", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_COMMA}, {",", "'", 1.0, Code, KEY_COMMA},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1327,7 +1350,7 @@ static struct key keys_compose_l[] = {
{"", "", 7, Pad}, {"", "", 7, Pad},
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Abc", "Abc", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_COMMA}, {",", "'", 1.0, Code, KEY_COMMA},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1349,7 +1372,7 @@ static struct key keys_compose_z[] = {
{"", "", 7, Pad}, {"", "", 7, Pad},
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Abc", "Abc", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_COMMA}, {",", "'", 1.0, Code, KEY_COMMA},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1369,7 +1392,7 @@ static struct key keys_compose_x[] = {
{"", "", 7, Pad}, {"", "", 7, Pad},
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Abc", "Abc", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_COMMA}, {",", "'", 1.0, Code, KEY_COMMA},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1393,7 +1416,7 @@ static struct key keys_compose_c[] = {
{"", "", 7, Pad}, {"", "", 7, Pad},
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Abc", "Abc", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_COMMA}, {",", "'", 1.0, Code, KEY_COMMA},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1411,7 +1434,7 @@ static struct key keys_compose_v[] = {
{"", "", 7, Pad}, {"", "", 7, Pad},
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Abc", "Abc", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_COMMA}, {",", "'", 1.0, Code, KEY_COMMA},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1430,7 +1453,7 @@ static struct key keys_compose_b[] = {
{"", "", 7, Pad}, {"", "", 7, Pad},
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Abc", "Abc", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_COMMA}, {",", "'", 1.0, Code, KEY_COMMA},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1473,7 +1496,7 @@ static struct key keys_compose_m[] = {
{"", "", 7, Pad}, {"", "", 7, Pad},
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Abc", "Abc", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_COMMA}, {",", "'", 1.0, Code, KEY_COMMA},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1492,7 +1515,7 @@ static struct key keys_compose_cyr_i[] = {
{"", "", 7, Pad}, {"", "", 7, Pad},
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Абв", "Абв", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_EQUAL}, {",", "'", 1.0, Code, KEY_EQUAL},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1510,7 +1533,7 @@ static struct key keys_compose_cyr_j[] = {
{"", "", 7, Pad}, {"", "", 7, Pad},
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Абв", "Абв", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_EQUAL}, {",", "'", 1.0, Code, KEY_EQUAL},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1528,7 +1551,7 @@ static struct key keys_compose_cyr_e[] = {
{"", "", 7, Pad}, {"", "", 7, Pad},
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Абв", "Абв", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_EQUAL}, {",", "'", 1.0, Code, KEY_EQUAL},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1546,7 +1569,7 @@ static struct key keys_compose_cyr_u[] = {
{"", "", 7, Pad}, {"", "", 7, Pad},
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Абв", "Абв", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_EQUAL}, {",", "'", 1.0, Code, KEY_EQUAL},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1564,7 +1587,7 @@ static struct key keys_compose_cyr_l[] = {
{"", "", 7, Pad}, {"", "", 7, Pad},
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Абв", "Абв", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_EQUAL}, {",", "'", 1.0, Code, KEY_EQUAL},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1582,7 +1605,7 @@ static struct key keys_compose_cyr_n[] = {
{"", "", 7, Pad}, {"", "", 7, Pad},
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Абв", "Абв", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_EQUAL}, {",", "'", 1.0, Code, KEY_EQUAL},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1601,7 +1624,7 @@ static struct key keys_compose_cyr_che[] = {
{"", "", 7, Pad}, {"", "", 7, Pad},
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Абв", "Абв", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_EQUAL}, {",", "'", 1.0, Code, KEY_EQUAL},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1620,7 +1643,7 @@ static struct key keys_compose_cyr_tse[] = {
{"", "", 7, Pad}, {"", "", 7, Pad},
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Абв", "Абв", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_EQUAL}, {",", "'", 1.0, Code, KEY_EQUAL},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1638,7 +1661,7 @@ static struct key keys_compose_cyr_g[] = {
{"", "", 7, Pad}, {"", "", 7, Pad},
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Абв", "Абв", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_EQUAL}, {",", "'", 1.0, Code, KEY_EQUAL},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1656,7 +1679,7 @@ static struct key keys_compose_cyr_k[] = {
{"", "", 7, Pad}, {"", "", 7, Pad},
{"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, {"", "", 1.5, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Абв", "Абв", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_EQUAL}, {",", "'", 1.0, Code, KEY_EQUAL},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1688,7 +1711,7 @@ static struct key keys_compose_math[] = {
{"", "", 1, Copy, 0x2014, 0, 0x2014}, {"", "", 1, Copy, 0x2014, 0, 0x2014},
{"", "", 2, Pad}, {"", "", 2, Pad},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Abc", "Abc", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{"-", "-", 1, Code, KEY_MINUS}, {"-", "-", 1, Code, KEY_MINUS},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1721,7 +1744,7 @@ static struct key keys_compose_punctuation[] = {
{"·", "·", 1, Copy, 0x2027, 0, 0x2027}, {"·", "·", 1, Copy, 0x2027, 0, 0x2027},
{"", "", 1, Pad}, {"", "", 1, Pad},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Abc", "Abc", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_COMMA, &layouts[ComposeMath]}, {",", "'", 1.0, Code, KEY_COMMA, &layouts[ComposeMath]},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},
@ -1747,7 +1770,7 @@ static struct key keys_compose_bracket[] = {
{"", "", 2, Mod, Shift, .scheme = 1}, {"", "", 2, Mod, Shift, .scheme = 1},
{"", "", 8, Pad}, {"", "", 8, Pad},
{"", "", 0.0, EndRow}, {"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, BackLayer}, {"Abc", "Abc", 1.0, BackLayer, .scheme = 1},
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
{",", "'", 1.0, Code, KEY_COMMA, &layouts[ComposeMath]}, {",", "'", 1.0, Code, KEY_COMMA, &layouts[ComposeMath]},
{"", "", 4.0, Code, KEY_SPACE}, {"", "", 4.0, Code, KEY_SPACE},

10
main.c
View File

@ -173,6 +173,9 @@ wl_touch_down(void *data, struct wl_touch *wl_touch, uint32_t serial,
next_key = kbd_get_key(&keyboard, touch_x, touch_y); next_key = kbd_get_key(&keyboard, touch_x, touch_y);
if (next_key) { if (next_key) {
kbd_press_key(&keyboard, next_key, time); kbd_press_key(&keyboard, next_key, time);
} else if (keyboard.compose) {
keyboard.compose = 0;
kbd_switch_layout(&keyboard, keyboard.prevlayout, keyboard.last_abc_index);
} }
} }
@ -245,6 +248,9 @@ wl_pointer_button(void *data, struct wl_pointer *wl_pointer, uint32_t serial,
next_key = kbd_get_key(&keyboard, cur_x, cur_y); next_key = kbd_get_key(&keyboard, cur_x, cur_y);
if (next_key) { if (next_key) {
kbd_press_key(&keyboard, next_key, time); kbd_press_key(&keyboard, next_key, time);
} else if (keyboard.compose) {
keyboard.compose = 0;
kbd_switch_layout(&keyboard, keyboard.prevlayout, keyboard.last_abc_index);
} }
} }
} }
@ -301,8 +307,10 @@ display_handle_geometry(void *data, struct wl_output *wl_output, int x, int y,
} }
keyboard.layout = &keyboard.layouts[layer]; keyboard.layout = &keyboard.layouts[layer];
keyboard.prevlayout = keyboard.layout;
keyboard.layer_index = 0; keyboard.layer_index = 0;
keyboard.prevlayout = keyboard.layout;
keyboard.last_abc_layout = keyboard.layout;
keyboard.last_abc_index = 0;
if (layer_surface) { if (layer_surface) {
zwlr_layer_surface_v1_set_size(layer_surface, 0, height); zwlr_layer_surface_v1_set_size(layer_surface, 0, height);