1
0
mirror of git://git.suckless.org/svkbd synced 2024-12-18 04:04:44 +00:00

exclude certain modifier keys and basic keys from being overlayed

This ensures that modifiers like shift/ctrl can be correctly used with the overlay.
This commit is contained in:
Maarten van Gompel 2021-07-11 17:53:42 +02:00 committed by Hiltjo Posthuma
parent e2828d4f7a
commit b70948b74c

View File

@ -1052,7 +1052,13 @@ showoverlay(int idx)
if (overlay[i].keysym == XK_Cancel) {
break;
}
while (keys[j].keysym == 0)
//certain modifier keys and basic keys are excluded from being overlayed:
while (keys[j].keysym == 0 || keys[j].keysym == XK_Shift_L ||
keys[j].keysym == XK_Shift_R || keys[j].keysym == XK_Control_L ||
keys[j].keysym == XK_Control_R || keys[j].keysym == XK_Alt_L ||
keys[j].keysym == XK_Alt_R || keys[j].keysym == XK_BackSpace ||
keys[j].keysym == XK_Return || keys[j].keysym == XK_space ||
keys[j].keysym == XK_Cancel)
j++;
if (overlay[i].width > 1)
j += overlay[i].width - 1;