[wiki] [sites] [tabbed] keycode: bump release patch || Quentin Rameau

From: <git_AT_suckless.org>
Date: Sat, 02 Jul 2016 22:40:16 +0200

commit 37f91d2e6eaf9657e0d91cf1d4acb718fa2e8616
Author: Quentin Rameau <quinq_AT_fifth.space>
Date: Sat Jul 2 22:38:31 2016 +0200

    [tabbed] keycode: bump release patch

diff --git a/tools.suckless.org/tabbed/patches/keycode.md b/tools.suckless.org/tabbed/patches/keycode.md
index 10d88b7..db80bb2 100644
--- a/tools.suckless.org/tabbed/patches/keycode.md
+++ b/tools.suckless.org/tabbed/patches/keycode.md
_AT_@ -5,7 +5,7 @@ This way, input is keyboard layout independant (adapt config.h to your keyboard
 
 Download
 --------
-* [tabbed-0.6-keycode.diff](tabbed-0.6-keycode.diff)
+* [tabbed-keycode-0.6.diff](tabbed-keycode-0.6.diff)
 * [tabbed-keycode-20160702-bc23614.diff](tabbed-keycode-20160702-bc23614.diff)
 
 Author
diff --git a/tools.suckless.org/tabbed/patches/tabbed-0.6-keycode.diff b/tools.suckless.org/tabbed/patches/tabbed-0.6-keycode.diff
deleted file mode 100644
index c9ccde3..0000000
--- a/tools.suckless.org/tabbed/patches/tabbed-0.6-keycode.diff
+++ /dev/null
_AT_@ -1,113 +0,0 @@
-diff --git a/config.def.h b/config.def.h
-index ceda9f7..088201a 100644
---- a/config.def.h
-+++ b/config.def.h
-_AT_@ -29,30 +29,30 @@ 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,             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,                       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 } },
--
--	{ 0,                            XK_F11,    fullscreen,     { 0 } },
-+	/* modifier                  key    function        argument */
-+	{ MODKEY|ShiftMask,          36,    focusonce,      { 0 } },      // Return
-+	{ MODKEY|ShiftMask,          36,    spawn,          { 0 } },      // Return
-+	{ MODKEY,                    44,    spawn,          SETPROP("_TABBED_SELECT_TAB") }, // t
-+
-+	{ MODKEY|ShiftMask,          46,   rotate,         { .i = +1 } }, // l
-+	{ MODKEY|ShiftMask,          43,   rotate,         { .i = -1 } }, // h
-+	{ MODKEY|ShiftMask,          44,   movetab,        { .i = -1 } }, // j
-+	{ MODKEY|ShiftMask,          45,   movetab,        { .i = +1 } }, // k
-+	{ MODKEY,                    23,   rotate,         { .i = 0 } },  // Tab
-+ 
-+	{ MODKEY,                    10,   move,           { .i = 0 } },  // 1
-+	{ MODKEY,                    11,   move,           { .i = 1 } },  // 2
-+	{ MODKEY,                    12,   move,           { .i = 2 } },  // 3
-+	{ MODKEY,                    13,   move,           { .i = 3 } },  // 4
-+	{ MODKEY,                    14,   move,           { .i = 4 } },  // 5
-+	{ MODKEY,                    15,   move,           { .i = 5 } },  // 6
-+	{ MODKEY,                    16,   move,           { .i = 6 } },  // 7
-+	{ MODKEY,                    17,   move,           { .i = 7 } },  // 8
-+	{ MODKEY,                    18,   move,           { .i = 8 } },  // 9
-+	{ MODKEY,                    19,   move,           { .i = 9 } },  // 0
-+
-+	{ MODKEY,                    24,   killclient,     { 0 } },       // q
-+
-+	{ 0,                         95,   fullscreen,     { 0 } },       // F11
- };
- 
-diff --git a/tabbed.c b/tabbed.c
-index 93a213a..744fe4e 100644
---- a/tabbed.c
-+++ b/tabbed.c
-_AT_@ -57,7 +57,7 @@ typedef union {
- 
- typedef struct {
- 	unsigned int mod;
--	KeySym keysym;
-+	KeyCode keycode;
- 	void (*func)(const Arg *);
- 	const Arg arg;
- } Key;
-_AT_@ -644,11 +644,9 @@ void
- 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));
-_AT_@ -684,7 +682,6 @@ manage(Window w) {
- 		int i, j, nextpos;
- 		unsigned int modifiers[] = { 0, LockMask, numlockmask,
- 			numlockmask|LockMask };
--		KeyCode code;
- 		Client *c;
- 		XEvent e;
- 
-_AT_@ -695,13 +692,11 @@ 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-0.6.diff b/tools.suckless.org/tabbed/patches/tabbed-keycode-0.6.diff
new file mode 100644
index 0000000..26bdd55
--- /dev/null
+++ b/tools.suckless.org/tabbed/patches/tabbed-keycode-0.6.diff
_AT_@ -0,0 +1,113 @@
+diff --git a/config.def.h b/config.def.h
+index ceda9f7..272074a 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -29,30 +29,30 @@ 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,             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,                       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 } },
+-
+-	{ 0,                            XK_F11,    fullscreen,     { 0 } },
++	/* modifier                  key    function        argument */
++	{ MODKEY|ShiftMask,          36,    focusonce,      { 0 } },      // Return
++	{ MODKEY|ShiftMask,          36,    spawn,          { 0 } },      // Return
++	{ MODKEY,                    44,    spawn,          SETPROP("_TABBED_SELECT_TAB") }, // t
++
++	{ MODKEY|ShiftMask,          46,   rotate,         { .i = +1 } }, // l
++	{ MODKEY|ShiftMask,          43,   rotate,         { .i = -1 } }, // h
++	{ MODKEY|ShiftMask,          44,   movetab,        { .i = -1 } }, // j
++	{ MODKEY|ShiftMask,          45,   movetab,        { .i = +1 } }, // k
++	{ MODKEY,                    23,   rotate,         { .i = 0 } },  // Tab
++
++	{ MODKEY,                    10,   move,           { .i = 0 } },  // 1
++	{ MODKEY,                    11,   move,           { .i = 1 } },  // 2
++	{ MODKEY,                    12,   move,           { .i = 2 } },  // 3
++	{ MODKEY,                    13,   move,           { .i = 3 } },  // 4
++	{ MODKEY,                    14,   move,           { .i = 4 } },  // 5
++	{ MODKEY,                    15,   move,           { .i = 5 } },  // 6
++	{ MODKEY,                    16,   move,           { .i = 6 } },  // 7
++	{ MODKEY,                    17,   move,           { .i = 7 } },  // 8
++	{ MODKEY,                    18,   move,           { .i = 8 } },  // 9
++	{ MODKEY,                    19,   move,           { .i = 9 } },  // 0
++
++	{ MODKEY,                    24,   killclient,     { 0 } },       // q
++
++	{ 0,                         95,   fullscreen,     { 0 } },       // F11
+ };
+ 
+diff --git a/tabbed.c b/tabbed.c
+index d30206b..15d6572 100644
+--- a/tabbed.c
++++ b/tabbed.c
+_AT_@ -57,7 +57,7 @@ typedef union {
+ 
+ typedef struct {
+ 	unsigned int mod;
+-	KeySym keysym;
++	KeyCode keycode;
+ 	void (*func)(const Arg *);
+ 	const Arg arg;
+ } Key;
+_AT_@ -644,11 +644,9 @@ void
+ 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));
+_AT_@ -684,7 +682,6 @@ manage(Window w) {
+ 		int i, j, nextpos;
+ 		unsigned int modifiers[] = { 0, LockMask, numlockmask,
+ 			numlockmask|LockMask };
+-		KeyCode code;
+ 		Client *c;
+ 		XEvent e;
+ 
+_AT_@ -695,13 +692,11 @@ 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);
+ 			}
+ 		}
+ 
Received on Sat Jul 02 2016 - 22:40:16 CEST

This archive was generated by hypermail 2.3.0 : Sat Jul 02 2016 - 22:48:21 CEST