wvkbd

git clone https://git.tarina.org/wvkbd
Log | Files | Refs | README | LICENSE

commit 9eee270dfd861af9b2f22c6525130cde0dd36f9d
parent e58e63f2da4c4b91da52c1eb9402e7fca3799f48
Author: Stacy Harper <contact@stacyharper.net>
Date:   Mon, 23 Aug 2021 16:36:11 +0200

Simplest key_mood

Diffstat:
Mkeyboard.h | 9++-------
1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/keyboard.h b/keyboard.h @@ -167,12 +167,11 @@ kbd_unpress_key(struct kbd *kb, uint32_t time) { void kbd_press_key(struct kbd *kb, struct key *k, uint32_t time) { - uint8_t mods_before; switch (k->type) { case Code: if (k->code_mod) { - mods_before = kb->mods; - kb->mods = k->code_mod; + zwp_virtual_keyboard_v1_modifiers(kb->vkbd, k->code_mod, 0, 0, 0); + } else { zwp_virtual_keyboard_v1_modifiers(kb->vkbd, kb->mods, 0, 0, 0); } if (compose == 1) { @@ -195,10 +194,6 @@ kbd_press_key(struct kbd *kb, struct key *k, uint32_t time) { compose++; } } - if (k->code_mod) { - kb->mods = mods_before; - zwp_virtual_keyboard_v1_modifiers(kb->vkbd, kb->mods, 0, 0, 0); - } break; case Mod: kb->mods ^= k->code;