Introduction
Introduction Statistics Contact Development Disclaimer Help
tabbed-keycode-0.6.diff - sites - public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log
Files
Refs
---
tabbed-keycode-0.6.diff (4750B)
---
1 diff --git a/config.def.h b/config.def.h
2 index ceda9f7..272074a 100644
3 --- a/config.def.h
4 +++ b/config.def.h
5 @@ -29,30 +29,30 @@ static Bool npisrelative = False;
6
7 #define MODKEY ControlMask
8 static Key keys[] = { \
9 - /* modifier key function argu…
10 - { MODKEY|ShiftMask, XK_Return, focusonce, { 0 …
11 - { MODKEY|ShiftMask, XK_Return, spawn, { 0 …
12 - { MODKEY, XK_t, spawn, SETP…
13 -
14 - { MODKEY|ShiftMask, XK_l, rotate, { .i…
15 - { MODKEY|ShiftMask, XK_h, rotate, { .i…
16 - { MODKEY|ShiftMask, XK_j, movetab, { .i…
17 - { MODKEY|ShiftMask, XK_k, movetab, { .i…
18 - { MODKEY, XK_Tab, rotate, { .i…
19 -
20 - { MODKEY, XK_1, move, { .i…
21 - { MODKEY, XK_2, move, { .i…
22 - { MODKEY, XK_3, move, { .i…
23 - { MODKEY, XK_4, move, { .i…
24 - { MODKEY, XK_5, move, { .i…
25 - { MODKEY, XK_6, move, { .i…
26 - { MODKEY, XK_7, move, { .i…
27 - { MODKEY, XK_8, move, { .i…
28 - { MODKEY, XK_9, move, { .i…
29 - { MODKEY, XK_0, move, { .i…
30 -
31 - { MODKEY, XK_q, killclient, { 0 …
32 -
33 - { 0, XK_F11, fullscreen, { 0 …
34 + /* modifier key function argument */
35 + { MODKEY|ShiftMask, 36, focusonce, { 0 } }, …
36 + { MODKEY|ShiftMask, 36, spawn, { 0 } }, …
37 + { MODKEY, 44, spawn, SETPROP("_T…
38 +
39 + { MODKEY|ShiftMask, 46, rotate, { .i = +1 } …
40 + { MODKEY|ShiftMask, 43, rotate, { .i = -1 } …
41 + { MODKEY|ShiftMask, 44, movetab, { .i = -1 } …
42 + { MODKEY|ShiftMask, 45, movetab, { .i = +1 } …
43 + { MODKEY, 23, rotate, { .i = 0 } }…
44 +
45 + { MODKEY, 10, move, { .i = 0 } }…
46 + { MODKEY, 11, move, { .i = 1 } }…
47 + { MODKEY, 12, move, { .i = 2 } }…
48 + { MODKEY, 13, move, { .i = 3 } }…
49 + { MODKEY, 14, move, { .i = 4 } }…
50 + { MODKEY, 15, move, { .i = 5 } }…
51 + { MODKEY, 16, move, { .i = 6 } }…
52 + { MODKEY, 17, move, { .i = 7 } }…
53 + { MODKEY, 18, move, { .i = 8 } }…
54 + { MODKEY, 19, move, { .i = 9 } }…
55 +
56 + { MODKEY, 24, killclient, { 0 } }, …
57 +
58 + { 0, 95, fullscreen, { 0 } }, …
59 };
60
61 diff --git a/tabbed.c b/tabbed.c
62 index d30206b..15d6572 100644
63 --- a/tabbed.c
64 +++ b/tabbed.c
65 @@ -57,7 +57,7 @@ typedef union {
66
67 typedef struct {
68 unsigned int mod;
69 - KeySym keysym;
70 + KeyCode keycode;
71 void (*func)(const Arg *);
72 const Arg arg;
73 } Key;
74 @@ -644,11 +644,9 @@ void
75 keypress(const XEvent *e) {
76 const XKeyEvent *ev = &e->xkey;
77 unsigned int i;
78 - KeySym keysym;
79
80 - keysym = XkbKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0, 0);
81 for(i = 0; i < LENGTH(keys); i++) {
82 - if(keysym == keys[i].keysym
83 + if(ev->keycode == keys[i].keycode
84 && CLEANMASK(keys[i].mod) == CLEANMASK(…
85 && keys[i].func) {
86 keys[i].func(&(keys[i].arg));
87 @@ -684,7 +682,6 @@ manage(Window w) {
88 int i, j, nextpos;
89 unsigned int modifiers[] = { 0, LockMask, numlockmask,
90 numlockmask|LockMask };
91 - KeyCode code;
92 Client *c;
93 XEvent e;
94
95 @@ -695,13 +692,11 @@ manage(Window w) {
96 XSync(dpy, False);
97
98 for(i = 0; i < LENGTH(keys); i++) {
99 - if((code = XKeysymToKeycode(dpy, keys[i].keysym…
100 - for(j = 0; j < LENGTH(modifiers); j++) {
101 - XGrabKey(dpy, code, keys[i].mod
102 - | modifiers[j],…
103 - True, GrabModeAsync,
104 - GrabModeAsync);
105 - }
106 + for(j = 0; j < LENGTH(modifiers); j++) {
107 + XGrabKey(dpy, keys[i].keycode, keys[i].…
108 + | modifiers[j], w,
109 + True, GrabModeAsync,
110 + GrabModeAsync);
111 }
112 }
113
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.