---- - config.def.h | 6 ++++++ - tabbed.c | 30 +++++++++++++++++++++++++++++- - 2 files changed, 35 insertions(+), 1 deletion(-) - -diff --git a/config.def.h b/config.def.h -index defa426..7bfda30 100644 ---- a/config.def.h -+++ b/config.def.h -_AT_@ -64,3 +64,9 @@ static Key keys[] = { - - { 0, XK_F11, fullscreen, { 0 } }, - }; -+ -+static Key keyreleases[] = { -+ /* modifier key function argument */ -+ { 0, XK_Shift_L, NULL, { 0 } }, -+ -+}; -diff --git a/tabbed.c b/tabbed.c -index ff3ada0..8d03bc6 100644 ---- a/tabbed.c -+++ b/tabbed.c -_AT_@ -113,6 +113,7 @@ static Bool gettextprop(Window w, Atom atom, char *text, unsigned int size); - static void initfont(const char *fontstr); - static Bool isprotodel(int c); - static void keypress(const XEvent *e); -+static void keyrelease(const XEvent *e); - static void killclient(const Arg *arg); - static void manage(Window win); - static void maprequest(const XEvent *e); -_AT_@ -149,6 +150,7 @@ static void (*handler[LASTEvent]) (const XEvent *) = { - [Expose] = expose, - [FocusIn] = focusin, - [KeyPress] = keypress, -+ [KeyRelease] = keyrelease, - [MapRequest] = maprequest, - [PropertyNotify] = propertynotify, - }; -_AT_@ -664,6 +666,22 @@ keypress(const XEvent *e) - } - } - -+void -+keyrelease(const XEvent *e) -+{ -+ const XKeyEvent *ev = &e->xkey; -+ unsigned int i; -+ KeySym keysym; -+ -+ keysym = XkbKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0, 0); -+ for (i = 0; i < LENGTH(keys); i++) { -+ if (keysym == keyreleases[i].keysym && -+ CLEANMASK(keyreleases[i].mod) == CLEANMASK(ev->state) && -+ keyreleases[i].func) -+ keyreleases[i].func(&(keyreleases[i].arg)); -+ } -+} -+ - void - killclient(const Arg *arg) - { -_AT_@ -714,6 +732,16 @@ manage(Window w) - } - } - -+ for (i = 0; i < LENGTH(keyreleases); i++) { -+ if ((code = XKeysymToKeycode(dpy, keyreleases[i].keysym))) { -+ for (j = 0; j < LENGTH(modifiers); j++) { -+ XGrabKey(dpy, code, keyreleases[i].mod | -+ modifiers[j], w, True, -+ GrabModeAsync, GrabModeAsync); -+ } -+ } -+ } -+ - c = ecalloc(1, sizeof *c); - c->win = w; - -_AT_@ -1036,7 +1064,7 @@ setup(void) - XMapRaised(dpy, win); - XSelectInput(dpy, win, SubstructureNotifyMask | FocusChangeMask | - ButtonPressMask | ExposureMask | KeyPressMask | -- PropertyChangeMask | StructureNotifyMask | -+ KeyReleaseMask | PropertyChangeMask | StructureNotifyMask | - SubstructureRedirectMask); - xerrorxlib = XSetErrorHandler(xerror); - --- -2.24.0 - diff --git a/tools.suckless.org/tabbed/patches/keyrelease/tabbed-keyrelease-20191216-b5f9e6.diff b/tools.suckless.org/tabbed/patches/keyrelease/tabbed-keyrelease-20191216-b5f9ec6.diff similarity index 100% rename from tools.suckless.org/tabbed/patches/keyrelease/tabbed-keyrelease-20191216-b5f9e6.diff rename to tools.suckless.org/tabbed/patches/keyrelease/tabbed-keyrelease-20191216-b5f9ec6.diffReceived on Thu Dec 19 2019 - 03:43:45 CET
This archive was generated by hypermail 2.3.0 : Thu Dec 19 2019 - 03:48:39 CET