exclude certain modifier keys and basic keys from being overlayed - svkbd - simple virtual keyboard
(HTM) git clone git://git.suckless.org/svkbd
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit b70948b74c19f916bc9e1a610ea1a2a215a54900
(DIR) parent e2828d4f7a290ebab671c3bfff162684c7779be0
(HTM) Author: Maarten van Gompel <proycon@anaproy.nl>
Date: Sun, 11 Jul 2021 17:53:42 +0200
exclude certain modifier keys and basic keys from being overlayed
This ensures that modifiers like shift/ctrl can be correctly used with the overlay.
Diffstat:
M svkbd.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
---
(DIR) diff --git a/svkbd.c b/svkbd.c
@@ -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;