add hkeys array which allows us to press ctrl+alt+shift+delete to exit

out of spmenu even if we unbind our quit keybind
This commit is contained in:
speedie 2023-05-15 09:53:34 +02:00
parent 12b69656a7
commit e7ecfd4114
2 changed files with 4 additions and 0 deletions

View file

@ -30,6 +30,9 @@ void keypress(XEvent *e) {
keysym = XkbKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0, 0); keysym = XkbKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0, 0);
// this makes sure we always have a way to exit if we unbind our quit key
if (keysym == hkeys[0].keysym && CLEANMASK(hkeys[0].mod) == CLEANMASK(ev->state) && hkeys[0].func) hkeys[0].func(&(hkeys[0].arg));
for (i = 0; i < LENGTH(keys); i++) { for (i = 0; i < LENGTH(keys); i++) {
if (ignoreglobalkeys) break; if (ignoreglobalkeys) break;
if (keysym == keys[i].keysym && CLEANMASK(keys[i].mod) == CLEANMASK(ev->state) && keys[i].func) { if (keysym == keys[i].keysym && CLEANMASK(keys[i].mod) == CLEANMASK(ev->state) && keys[i].func) {

View file

@ -23,3 +23,4 @@ static void getcapsstate(void);
static Key ckeys[256]; static Key ckeys[256];
static char capstext[16]; static char capstext[16];
static Key hkeys[1] = { { -1, Ctrl|Alt|Shift, XK_Delete, quit, {0} } };