diff options
author | Anselm R. Garbe <garbeam@wmii.de> | 2006-07-11 12:52:57 +0200 |
---|---|---|
committer | Anselm R. Garbe <garbeam@wmii.de> | 2006-07-11 12:52:57 +0200 |
commit | 16c67f32d62849792c8e6d4fdec22a1896f9c279 (patch) | |
tree | cb18262f3e207d8229bf0f8833f602a7b7903b03 /key.c | |
parent | 366d81e313e6dd4e9e6c61ed8dfca4b4b40ccde6 (diff) | |
download | dwm-16c67f32d62849792c8e6d4fdec22a1896f9c279.tar.gz |
fixed several stuff (gridwm gets better and better)
Diffstat (limited to 'key.c')
-rw-r--r-- | key.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -24,3 +24,20 @@ update_keys() XGrabKey(dpy, code, key[i].mod, root, True, GrabModeAsync, GrabModeAsync); } } + +void +keypress(XEvent *e) +{ + XKeyEvent *ev = &e->xkey; + unsigned int i, len; + KeySym keysym; + + keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0); + len = sizeof(key) / sizeof(key[0]); + for(i = 0; i < len; i++) + if((keysym == key[i].keysym) && (key[i].mod == ev->state)) { + if(key[i].func) + key[i].func(key[i].arg); + return; + } +} |