svkbd

simple virtual keyboard
git clone git://git.suckless.org/svkbd
Log | Files | Refs | README | LICENSE

commit 72b936baf6f179797118f86464d7aa1b7e960deb
parent bd3620acf47d9a351fd345ea02b19c3095b92a4f
Author: Maarten van Gompel <proycon@anaproy.nl>
Date:   Sun,  7 Mar 2021 00:44:38 +0100

Allow toggling modifier keys even when an overlay is displayed

Diffstat:
Msvkbd.c | 8+++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/svkbd.c b/svkbd.c @@ -572,8 +572,7 @@ unpress(Key *k, KeySym mod) simulate_keypress(keys[i].keysym); } } - pressedmod = mod; - if (pressedmod) { + if (mod) { simulate_keypress(mod); } simulate_keypress(k->keysym); @@ -600,10 +599,9 @@ unpress(Key *k, KeySym mod) } } if (i != numkeys) { - if (pressedmod) { + if (mod) { simulate_keyrelease(mod); } - pressedmod = 0; for (i = 0; i < numkeys; i++) { if (keys[i].pressed) { @@ -614,7 +612,7 @@ unpress(Key *k, KeySym mod) } } - if (enableoverlays && currentoverlay != -1) { + if (enableoverlays && currentoverlay != -1 && !IsModifierKey(k->keysym)) { if (releaseprotect) { releaseprotect = 0; } else {