From 16c67f32d62849792c8e6d4fdec22a1896f9c279 Mon Sep 17 00:00:00 2001 From: "Anselm R. Garbe" Date: Tue, 11 Jul 2006 12:52:57 +0200 Subject: fixed several stuff (gridwm gets better and better) --- key.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'key.c') diff --git a/key.c b/key.c index a8742daf..b5d46c6e 100644 --- a/key.c +++ b/key.c @@ -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; + } +} -- cgit v1.2.3