8
|
1 /*
|
|
2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
|
3 * See LICENSE file for license details.
|
|
4 */
|
|
5
|
|
6 #include "wm.h"
|
|
7
|
|
8 #include <X11/keysym.h>
|
|
9
|
|
10 static Key key[] = {
|
|
11 KEYS
|
|
12 };
|
|
13
|
|
14 void
|
|
15 update_keys()
|
|
16 {
|
|
17 unsigned int i, len;
|
|
18 KeyCode code;
|
|
19
|
|
20 len = sizeof(key) / sizeof(key[0]);
|
|
21 for(i = 0; i < len; i++) {
|
|
22 code = XKeysymToKeycode(dpy, key[i].keysym);
|
|
23 XUngrabKey(dpy, code, key[i].mod, root);
|
|
24 XGrabKey(dpy, code, key[i].mod, root, True, GrabModeAsync, GrabModeAsync);
|
|
25 }
|
|
26 }
|