dwm-meillo

view 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
line source
1 /*
2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
3 * See LICENSE file for license details.
4 */
6 #include "wm.h"
8 #include <X11/keysym.h>
10 static Key key[] = {
11 KEYS
12 };
14 void
15 update_keys()
16 {
17 unsigned int i, len;
18 KeyCode code;
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 }