Also release shift after key release

This commit is contained in:
Maarten van Gompel
2021-08-24 00:43:01 +02:00
committed by John Sullivan
parent 879522a76e
commit c6ca5832d4
2 changed files with 50 additions and 45 deletions

View File

@ -57,8 +57,8 @@ struct key {
struct layout {
struct key *keys;
uint32_t keyheight; //absolute height (pixels)
const char * keymap_name;
uint32_t keyheight; //absolute height (pixels)
};
struct kbd {
@ -167,14 +167,19 @@ kbd_unpress_key(struct kbd *kb, uint32_t time) {
}
kb->last_press = NULL;
if (compose >= 2) {
compose = 0;
if ((!kb->prevlayout) || (strcmp(kb->prevlayout->keymap_name, kb->layout->keymap_name) != 0)) {
create_and_upload_keymap(kb->layout->keymap_name, 0, 0);
}
kb->layout = kb->prevlayout;
if (kb->mods & Shift == Shift) kb->mods ^= Shift;
kbd_draw_layout(kb);
} else if (kb->mods & Shift == Shift) {
kb->mods ^= Shift;
kbd_draw_layout(kb);
}
}
}
}