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