From 366d81e313e6dd4e9e6c61ed8dfca4b4b40ccde6 Mon Sep 17 00:00:00 2001 From: "Anselm R. Garbe" Date: Tue, 11 Jul 2006 11:50:18 +0200 Subject: added key handling --- key.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 key.c (limited to 'key.c') diff --git a/key.c b/key.c new file mode 100644 index 00000000..a8742daf --- /dev/null +++ b/key.c @@ -0,0 +1,26 @@ +/* + * (C)opyright MMVI Anselm R. Garbe + * See LICENSE file for license details. + */ + +#include "wm.h" + +#include + +static Key key[] = { + KEYS +}; + +void +update_keys() +{ + unsigned int i, len; + KeyCode code; + + len = sizeof(key) / sizeof(key[0]); + for(i = 0; i < len; i++) { + code = XKeysymToKeycode(dpy, key[i].keysym); + XUngrabKey(dpy, code, key[i].mod, root); + XGrabKey(dpy, code, key[i].mod, root, True, GrabModeAsync, GrabModeAsync); + } +} -- cgit v1.2.3