sites

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit ad70cbd77e09e2ff3dfabeef568111709a3636aa
parent 0f78ed2ae90d9ce6e79b605a5d3f18d9102497d8
Author: Quentin Rameau <quinq@fifth.space>
Date:   Mon,  8 May 2017 10:07:11 +0200

[tabbed] Update keycode patch

Diffstat:
Mtools.suckless.org/tabbed/patches/keycode.md | 2+-
Dtools.suckless.org/tabbed/patches/tabbed-keycode-20160702-bc23614.diff | 110-------------------------------------------------------------------------------
Atools.suckless.org/tabbed/patches/tabbed-keycode-20170508-6dc3978.diff | 109+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 110 insertions(+), 111 deletions(-)

diff --git a/tools.suckless.org/tabbed/patches/keycode.md b/tools.suckless.org/tabbed/patches/keycode.md @@ -6,7 +6,7 @@ This way, input is keyboard layout independant (adapt config.h to your keyboard Download -------- * [tabbed-keycode-0.6.diff](tabbed-keycode-0.6.diff) -* [tabbed-keycode-20160702-bc23614.diff](tabbed-keycode-20160702-bc23614.diff) +* [tabbed-keycode-20170508-6dc3978.diff](tabbed-keycode-20170508-6dc3978.dif) Author ------ diff --git a/tools.suckless.org/tabbed/patches/tabbed-keycode-20160702-bc23614.diff b/tools.suckless.org/tabbed/patches/tabbed-keycode-20160702-bc23614.diff @@ -1,110 +0,0 @@ -diff --git a/config.def.h b/config.def.h -index 989992c..821f481 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -36,31 +36,32 @@ static Bool npisrelative = False; - #define MODKEY ControlMask - static Key keys[] = { - /* modifier key function argument */ -- { MODKEY|ShiftMask, XK_Return, focusonce, { 0 } }, -- { MODKEY|ShiftMask, XK_Return, spawn, { 0 } }, -- { MODKEY, XK_t, spawn, SETPROP("_TABBED_SELECT_TAB") }, -+ { MODKEY|ShiftMask, 36, focusonce, { 0 } }, -+ { MODKEY|ShiftMask, 36, spawn, { 0 } }, -+ { MODKEY, 28, spawn, SETPROP("_TABBED_SELECT_TAB") }, - -- { MODKEY|ShiftMask, XK_l, rotate, { .i = +1 } }, -- { MODKEY|ShiftMask, XK_h, rotate, { .i = -1 } }, -- { MODKEY|ShiftMask, XK_j, movetab, { .i = -1 } }, -- { MODKEY|ShiftMask, XK_k, movetab, { .i = +1 } }, -- { MODKEY, XK_Tab, rotate, { .i = 0 } }, -+ { MODKEY|ShiftMask, 46, rotate, { .i = +1 } }, -+ { MODKEY|ShiftMask, 43, rotate, { .i = -1 } }, -+ { MODKEY|ShiftMask, 44, movetab, { .i = -1 } }, -+ { MODKEY|ShiftMask, 45, movetab, { .i = +1 } }, -+ { MODKEY, 23, rotate, { .i = 0 } }, - -- { MODKEY, XK_1, move, { .i = 0 } }, -- { MODKEY, XK_2, move, { .i = 1 } }, -- { MODKEY, XK_3, move, { .i = 2 } }, -- { MODKEY, XK_4, move, { .i = 3 } }, -- { MODKEY, XK_5, move, { .i = 4 } }, -- { MODKEY, XK_6, move, { .i = 5 } }, -- { MODKEY, XK_7, move, { .i = 6 } }, -- { MODKEY, XK_8, move, { .i = 7 } }, -- { MODKEY, XK_9, move, { .i = 8 } }, -- { MODKEY, XK_0, move, { .i = 9 } }, - -- { MODKEY, XK_q, killclient, { 0 } }, -+ { MODKEY, 10, move, { .i = 0 } }, -+ { MODKEY, 11, move, { .i = 1 } }, -+ { MODKEY, 12, move, { .i = 2 } }, -+ { MODKEY, 13, move, { .i = 3 } }, -+ { MODKEY, 14, move, { .i = 4 } }, -+ { MODKEY, 15, move, { .i = 5 } }, -+ { MODKEY, 16, move, { .i = 6 } }, -+ { MODKEY, 17, move, { .i = 7 } }, -+ { MODKEY, 18, move, { .i = 8 } }, -+ { MODKEY, 19, move, { .i = 9 } }, - -- { MODKEY, XK_u, focusurgent, { 0 } }, -- { MODKEY|ShiftMask, XK_u, toggle, { .v = (void*) &urgentswitch } }, -+ { MODKEY, 24, killclient, { 0 } }, - -- { 0, XK_F11, fullscreen, { 0 } }, -+ { MODKEY, 30, focusurgent, { .v = NULL } }, -+ { MODKEY|ShiftMask, 30, toggle, { .v = (void*) &urgentswitch } }, -+ -+ { 0, 95, fullscreen, { 0 } }, - }; -diff --git a/tabbed.c b/tabbed.c -index 9a44795..5e2b416 100644 ---- a/tabbed.c -+++ b/tabbed.c -@@ -58,7 +58,7 @@ typedef union { - - typedef struct { - unsigned int mod; -- KeySym keysym; -+ KeyCode keycode; - void (*func)(const Arg *); - const Arg arg; - } Key; -@@ -651,11 +651,9 @@ keypress(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 == keys[i].keysym && -+ if (ev->keycode == keys[i].keycode && - CLEANMASK(keys[i].mod) == CLEANMASK(ev->state) && - keys[i].func) - keys[i].func(&(keys[i].arg)); -@@ -692,7 +690,6 @@ manage(Window w) - int i, j, nextpos; - unsigned int modifiers[] = { 0, LockMask, numlockmask, - numlockmask | LockMask }; -- KeyCode code; - Client *c; - XEvent e; - -@@ -703,12 +700,10 @@ manage(Window w) - XSync(dpy, False); - - for (i = 0; i < LENGTH(keys); i++) { -- if ((code = XKeysymToKeycode(dpy, keys[i].keysym))) { -- for (j = 0; j < LENGTH(modifiers); j++) { -- XGrabKey(dpy, code, keys[i].mod | -- modifiers[j], w, True, -- GrabModeAsync, GrabModeAsync); -- } -+ for (j = 0; j < LENGTH(modifiers); ++j) { -+ XGrabKey(dpy, keys[i].keycode, -+ keys[i].mod | modifiers[j], w, -+ True, GrabModeAsync, GrabModeAsync); - } - } - diff --git a/tools.suckless.org/tabbed/patches/tabbed-keycode-20170508-6dc3978.diff b/tools.suckless.org/tabbed/patches/tabbed-keycode-20170508-6dc3978.diff @@ -0,0 +1,109 @@ +diff --git a/config.def.h b/config.def.h +index 2d23049..b1384e4 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -36,31 +36,31 @@ static Bool npisrelative = False; + #define MODKEY ControlMask + static Key keys[] = { + /* modifier key function argument */ +- { MODKEY|ShiftMask, XK_Return, focusonce, { 0 } }, +- { MODKEY|ShiftMask, XK_Return, spawn, { 0 } }, ++ { MODKEY|ShiftMask, 36, focusonce, { 0 } }, ++ { MODKEY|ShiftMask, 36, spawn, { 0 } }, + +- { MODKEY|ShiftMask, XK_l, rotate, { .i = +1 } }, +- { MODKEY|ShiftMask, XK_h, rotate, { .i = -1 } }, +- { MODKEY|ShiftMask, XK_j, movetab, { .i = -1 } }, +- { MODKEY|ShiftMask, XK_k, movetab, { .i = +1 } }, +- { MODKEY, XK_Tab, rotate, { .i = 0 } }, ++ { MODKEY|ShiftMask, 46, rotate, { .i = +1 } }, ++ { MODKEY|ShiftMask, 43, rotate, { .i = -1 } }, ++ { MODKEY|ShiftMask, 44, movetab, { .i = -1 } }, ++ { MODKEY|ShiftMask, 45, movetab, { .i = +1 } }, ++ { MODKEY, 23, rotate, { .i = 0 } }, + +- { MODKEY, XK_grave, spawn, SETPROP("_TABBED_SELECT_TAB") }, +- { MODKEY, XK_1, move, { .i = 0 } }, +- { MODKEY, XK_2, move, { .i = 1 } }, +- { MODKEY, XK_3, move, { .i = 2 } }, +- { MODKEY, XK_4, move, { .i = 3 } }, +- { MODKEY, XK_5, move, { .i = 4 } }, +- { MODKEY, XK_6, move, { .i = 5 } }, +- { MODKEY, XK_7, move, { .i = 6 } }, +- { MODKEY, XK_8, move, { .i = 7 } }, +- { MODKEY, XK_9, move, { .i = 8 } }, +- { MODKEY, XK_0, move, { .i = 9 } }, ++ { MODKEY, 49, spawn, SETPROP("_TABBED_SELECT_TAB") }, ++ { MODKEY, 10, move, { .i = 0 } }, ++ { MODKEY, 11, move, { .i = 1 } }, ++ { MODKEY, 12, move, { .i = 2 } }, ++ { MODKEY, 13, move, { .i = 3 } }, ++ { MODKEY, 14, move, { .i = 4 } }, ++ { MODKEY, 15, move, { .i = 5 } }, ++ { MODKEY, 16, move, { .i = 6 } }, ++ { MODKEY, 17, move, { .i = 7 } }, ++ { MODKEY, 18, move, { .i = 8 } }, ++ { MODKEY, 19, move, { .i = 9 } }, + +- { MODKEY, XK_q, killclient, { 0 } }, ++ { MODKEY, 24, killclient, { 0 } }, + +- { MODKEY, XK_u, focusurgent, { 0 } }, +- { MODKEY|ShiftMask, XK_u, toggle, { .v = (void*) &urgentswitch } }, ++ { MODKEY, 30, focusurgent, { .v = NULL } }, ++ { MODKEY|ShiftMask, 30, toggle, { .v = (void*) &urgentswitch } }, + +- { 0, XK_F11, fullscreen, { 0 } }, ++ { 0, 95, fullscreen, { 0 } }, + }; +diff --git a/tabbed.c b/tabbed.c +index ff3ada0..e30b4e2 100644 +--- a/tabbed.c ++++ b/tabbed.c +@@ -58,7 +58,7 @@ typedef union { + + typedef struct { + unsigned int mod; +- KeySym keysym; ++ KeyCode keycode; + void (*func)(const Arg *); + const Arg arg; + } Key; +@@ -653,11 +653,9 @@ keypress(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 == keys[i].keysym && ++ if (ev->keycode == keys[i].keycode && + CLEANMASK(keys[i].mod) == CLEANMASK(ev->state) && + keys[i].func) + keys[i].func(&(keys[i].arg)); +@@ -694,7 +692,6 @@ manage(Window w) + int i, j, nextpos; + unsigned int modifiers[] = { 0, LockMask, numlockmask, + numlockmask | LockMask }; +- KeyCode code; + Client *c; + XEvent e; + +@@ -705,12 +702,10 @@ manage(Window w) + XSync(dpy, False); + + for (i = 0; i < LENGTH(keys); i++) { +- if ((code = XKeysymToKeycode(dpy, keys[i].keysym))) { +- for (j = 0; j < LENGTH(modifiers); j++) { +- XGrabKey(dpy, code, keys[i].mod | +- modifiers[j], w, True, +- GrabModeAsync, GrabModeAsync); +- } ++ for (j = 0; j < LENGTH(modifiers); ++j) { ++ XGrabKey(dpy, keys[i].keycode, ++ keys[i].mod | modifiers[j], w, ++ True, GrabModeAsync, GrabModeAsync); + } + } +