mirror of
https://github.com/jjsullivan5196/wvkbd.git
synced 2025-03-12 18:32:48 +01:00
shift + space = tab
This is implemented not in the keymap but as a hack in wvkbd itself, the keymap would output shift + tab otherwise.
This commit is contained in:
parent
17863cdabc
commit
29e32edf5c
21
keyboard.c
21
keyboard.c
@ -271,8 +271,14 @@ kbd_unpress_key(struct kbd *kb, uint32_t time) {
|
||||
zwp_virtual_keyboard_v1_key(kb->vkbd, time, 127, // COMP key
|
||||
WL_KEYBOARD_KEY_STATE_RELEASED);
|
||||
} else {
|
||||
zwp_virtual_keyboard_v1_key(kb->vkbd, time, kb->last_press->code,
|
||||
WL_KEYBOARD_KEY_STATE_RELEASED);
|
||||
if ((kb->last_press->code == KEY_SPACE) && (unlatch_shift)) {
|
||||
//shift + space is tab
|
||||
zwp_virtual_keyboard_v1_key(kb->vkbd, time, KEY_TAB,
|
||||
WL_KEYBOARD_KEY_STATE_RELEASED);
|
||||
} else {
|
||||
zwp_virtual_keyboard_v1_key(kb->vkbd, time, kb->last_press->code,
|
||||
WL_KEYBOARD_KEY_STATE_RELEASED);
|
||||
}
|
||||
}
|
||||
|
||||
if (kb->compose >= 2) {
|
||||
@ -361,8 +367,15 @@ kbd_press_key(struct kbd *kb, struct key *k, uint32_t time) {
|
||||
}
|
||||
kb->last_swipe = kb->last_press = k;
|
||||
kbd_draw_key(kb, k, Press);
|
||||
zwp_virtual_keyboard_v1_key(kb->vkbd, time, kb->last_press->code,
|
||||
WL_KEYBOARD_KEY_STATE_PRESSED);
|
||||
if ((k->code == KEY_SPACE) && (kb->mods & Shift)) {
|
||||
//shift space is tab
|
||||
zwp_virtual_keyboard_v1_modifiers(kb->vkbd, 0, 0, 0, 0);
|
||||
zwp_virtual_keyboard_v1_key(kb->vkbd, time, KEY_TAB,
|
||||
WL_KEYBOARD_KEY_STATE_PRESSED);
|
||||
} else {
|
||||
zwp_virtual_keyboard_v1_key(kb->vkbd, time, kb->last_press->code,
|
||||
WL_KEYBOARD_KEY_STATE_PRESSED);
|
||||
}
|
||||
if (kb->print || kb->print_intersect)
|
||||
kbd_print_key_stdout(kb, k);
|
||||
if (kb->compose) {
|
||||
|
@ -238,7 +238,7 @@ static struct key keys_full[] = {
|
||||
{"⌨͕", "⌨͔", 1.5, NextLayer, .scheme = 1},
|
||||
{"Cmp", "Cmp", 1.0, Compose, .scheme = 1},
|
||||
{",", "'", 1.0, Code, KEY_COMMA, &layouts[ComposeMath]},
|
||||
{"", "", 4.0, Code, KEY_SPACE},
|
||||
{"", "Tab", 4.0, Code, KEY_SPACE},
|
||||
{".", "?", 1.0, Code, KEY_DOT, &layouts[ComposePunctuation]},
|
||||
{"Enter", "Enter", 1.5, Code, KEY_ENTER, .scheme = 1},
|
||||
|
||||
@ -312,7 +312,7 @@ static struct key keys_full_wide[] = {
|
||||
{"⌨͕", "⌨͔", 1.5, NextLayer, .scheme = 1},
|
||||
{"Cmp", "Cmp", 1.0, Compose, .scheme = 1},
|
||||
{",", "'", 1.0, Code, KEY_COMMA, &layouts[ComposeMath]},
|
||||
{"", "", 4.0, Code, KEY_SPACE},
|
||||
{"", "Tab", 4.0, Code, KEY_SPACE},
|
||||
{".", "?", 1.0, Code, KEY_DOT, &layouts[ComposePunctuation]},
|
||||
{"Enter", "Enter", 1.5, Code, KEY_ENTER, .scheme = 1},
|
||||
|
||||
@ -371,7 +371,7 @@ static struct key keys_special[] = {
|
||||
{"Abc", "Abc", 1.0, BackLayer, .scheme = 1},
|
||||
{"⌨͕", "⌨͔", 1.0, NextLayer, .scheme = 1},
|
||||
{",", "'", 1.0, Code, KEY_COMMA, &layouts[ComposeMath]},
|
||||
{"", "", 4.0, Code, KEY_SPACE},
|
||||
{"", "Tab", 4.0, Code, KEY_SPACE},
|
||||
{".", "?", 1.0, Code, KEY_DOT, &layouts[ComposePunctuation]},
|
||||
{"Enter", "Enter", 2.0, Code, KEY_ENTER, .scheme = 1},
|
||||
|
||||
@ -393,7 +393,7 @@ static struct key keys_specialpad[] = {
|
||||
{"", "", 0.0, EndRow},
|
||||
//{"Tab", "Tab", 1.0, Code, KEY_TAB, .scheme = 1},
|
||||
{"←", "←", 1.0, Code, KEY_LEFT, .scheme = 1},
|
||||
{"", "", 1.0, Code, KEY_SPACE},
|
||||
{"", "↹", 1.0, Code, KEY_SPACE},
|
||||
{"→", "→", 1.0, Code, KEY_RIGHT, .scheme = 1},
|
||||
{".", "?", 1.0, Code, KEY_DOT},
|
||||
{"[", "{", 1.0, Code, KEY_LEFTBRACE},
|
||||
@ -473,7 +473,7 @@ static struct key keys_simple[] = {
|
||||
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
|
||||
{"-", "_", 0.75, Code, KEY_MINUS, &layouts[ComposeMath]},
|
||||
{",", "'", 0.75, Code, KEY_COMMA, &layouts[ComposeMath]},
|
||||
{"", "", 3.0, Code, KEY_SPACE},
|
||||
{"", "Tab", 3.0, Code, KEY_SPACE},
|
||||
{".", "?", 1.0, Code, KEY_DOT, &layouts[ComposePunctuation]},
|
||||
{"Enter", "Enter", 1.5, Code, KEY_ENTER, .scheme = 1},
|
||||
|
||||
@ -550,7 +550,7 @@ static struct key keys_simplegrid[] = {
|
||||
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
|
||||
{"-", "_", 1.0, Code, KEY_MINUS, &layouts[ComposeMath]},
|
||||
{"Cmp", "Cmp", 1.0, Compose, .scheme = 1},
|
||||
{"", "", 3.0, Code, KEY_SPACE},
|
||||
{"", "Tab", 3.0, Code, KEY_SPACE},
|
||||
{".", "?", 1.0, Code, KEY_DOT, &layouts[ComposePunctuation]},
|
||||
{"Enter", "Enter", 2.0, Code, KEY_ENTER, .scheme = 1},
|
||||
|
||||
@ -616,7 +616,7 @@ static struct key keys_cyrillic[] = {
|
||||
{"⌨͕", "⌨͔", 1.0, NextLayer, .scheme = 1},
|
||||
{"Cmp", "Cmp", 1.0, Compose, .scheme = 1},
|
||||
{",", "'", 1.0, Code, KEY_EQUAL, &layouts[ComposeMath]},
|
||||
{"", "", 4.0, Code, KEY_SPACE},
|
||||
{"", "Tab", 4.0, Code, KEY_SPACE},
|
||||
{".", "?", 1.0, Code, KEY_SLASH, &layouts[ComposePunctuation]},
|
||||
{"Enter", "Enter", 2.0, Code, KEY_ENTER, .scheme = 1},
|
||||
|
||||
@ -680,7 +680,7 @@ static struct key keys_arabic[] = {
|
||||
{"⌨͕", "⌨͔", 1.0, NextLayer, .scheme = 1},
|
||||
{"⇧", "⇫", 1.0, Mod, Shift, .scheme = 1},
|
||||
{"Cmp", "Cmp", 1.0, Compose, .scheme = 1},
|
||||
{"", "", 5.0, Code, KEY_SPACE},
|
||||
{"", "Tab", 5.0, Code, KEY_SPACE},
|
||||
{"Enter", "Enter", 2.0, Code, KEY_ENTER, .scheme = 1},
|
||||
|
||||
/* end of layout */
|
||||
@ -740,7 +740,7 @@ static struct key keys_georgian[] = {
|
||||
{"⌨͕", "⌨͔", 1.0, NextLayer, .scheme = 1},
|
||||
{"⇧", "⇫", 1.0, Mod, Shift, .scheme = 1},
|
||||
{"Cmp", "Cmp", 1.0, Compose, .scheme = 1},
|
||||
{"", "", 5.0, Code, KEY_SPACE},
|
||||
{"", "Tab", 5.0, Code, KEY_SPACE},
|
||||
{"Enter", "Enter", 2.0, Code, KEY_ENTER, .scheme = 1},
|
||||
|
||||
/* end of layout */
|
||||
@ -805,7 +805,7 @@ static struct key keys_persian[] = {
|
||||
{"⌨͕", "⌨͔", 1.0, NextLayer, .scheme = 1},
|
||||
{"Cmp", "Cmp", 1.0, Compose, .scheme = 1},
|
||||
{".", "،", 1.0, Code, KEY_DOT, &layouts[ComposePunctuation]},
|
||||
{"", "", 4.0, Code, KEY_SPACE},
|
||||
{"", "Tab", 4.0, Code, KEY_SPACE},
|
||||
{"⥣", "↥", 1.0, Code, KEY_GRAVE},
|
||||
{"؟", "!", 1.0, Code, KEY_SLASH, &layouts[ComposePunctuation]},
|
||||
{"Enter", "Enter", 2.0, Code, KEY_ENTER, .scheme = 1},
|
||||
@ -867,7 +867,7 @@ static struct key keys_greek[] = {
|
||||
|
||||
{"⌨͕", "⌨͔", 1.5, NextLayer, .scheme = 1},
|
||||
{",", "'", 1.0, Code, KEY_COMMA, &layouts[ComposeMath]},
|
||||
{"", "", 5, Code, KEY_SPACE},
|
||||
{"", "Tab", 5, Code, KEY_SPACE},
|
||||
{".", "\"", 1.0, Code, KEY_DOT, &layouts[ComposePunctuation]},
|
||||
{"Enter", "Enter", 2, Code, KEY_ENTER, .scheme = 1},
|
||||
|
||||
@ -916,7 +916,7 @@ static struct key keys_hebrew[] = {
|
||||
{"⌨͕", "⌨͔", 1.0, NextLayer, .scheme = 1},
|
||||
{"Cmp", "Cmp", 1.0, Compose, .scheme = 1},
|
||||
{",", "\"", 1.0, Code, KEY_APOSTROPHE, &layouts[ComposeMath]},
|
||||
{"", "", 3.5, Code, KEY_SPACE},
|
||||
{"", "Tab", 3.5, Code, KEY_SPACE},
|
||||
{".", "?", 1.0, Code, KEY_SLASH, &layouts[ComposePunctuation]},
|
||||
{"?", "?", 1.0, Code, KEY_SLASH, &layouts[ComposePunctuation], Shift},
|
||||
{"Enter", "Enter", 1.5, Code, KEY_ENTER, .scheme = 1},
|
||||
@ -1125,7 +1125,7 @@ static struct key keys_nav[] = {
|
||||
{"", "", 0.0, EndRow},
|
||||
|
||||
{"⌨͕", "⌨͔", 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_PAGEDOWN, .scheme = 1},
|
||||
{"", "", 0.0, Last},
|
||||
@ -1208,7 +1208,7 @@ static struct key keys_landscape[] = {
|
||||
{"Cmp", "Cmp", 1.0, Compose, .scheme = 1},
|
||||
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
|
||||
{",", "'", 1.0, Code, KEY_COMMA, &layouts[ComposeMath]},
|
||||
{"", "", 5.0, Code, KEY_SPACE},
|
||||
{"", "Tab", 5.0, Code, KEY_SPACE},
|
||||
{".", "?", 1.0, Code, KEY_DOT, &layouts[ComposePunctuation]},
|
||||
{"Enter", "Enter", 2.0, Code, KEY_ENTER, .scheme = 1},
|
||||
|
||||
@ -1266,7 +1266,7 @@ static struct key keys_landscape_special[] = {
|
||||
{"⌨͕", "⌨͔", 1.0, NextLayer, .scheme = 1},
|
||||
{"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1},
|
||||
{"Sup", "Sup", 1.0, Mod, Super, .scheme = 1},
|
||||
{"", "", 5.0, Code, KEY_SPACE},
|
||||
{"", "Tab", 5.0, Code, KEY_SPACE},
|
||||
{"Alt", "Alt", 1.0, Mod, Alt, .scheme = 1},
|
||||
{"AGr", "AGr", 1.0, Mod, AltGr, .scheme = 1},
|
||||
{"Enter", "Enter", 2.0, Code, KEY_ENTER, .scheme = 1},
|
||||
|
Loading…
x
Reference in New Issue
Block a user