Mercurial > aewl
comparison key.c @ 8:7066ff2fe8bc
added key handling
author | Anselm R. Garbe <garbeam@wmii.de> |
---|---|
date | Tue, 11 Jul 2006 11:50:18 +0200 |
parents | |
children | d567f430a81d |
comparison
equal
deleted
inserted
replaced
7:49e2fc9fb94f | 8:7066ff2fe8bc |
---|---|
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 } |