aewl

diff event.c @ 271:e9dc5a9f9480

implemented ungrabkeys() which is called in cleanup()
author Anselm R.Garbe <arg@10ksloc.org>
date Mon, 14 Aug 2006 10:24:38 +0200
parents dacd3f3c5823
children 97e8cb712fd9
line diff
     1.1 --- a/event.c	Mon Aug 14 10:18:24 2006 +0200
     1.2 +++ b/event.c	Mon Aug 14 10:24:38 2006 +0200
     1.3 @@ -370,3 +370,19 @@
     1.4  				GrabModeAsync, GrabModeAsync);
     1.5  	}
     1.6  }
     1.7 +
     1.8 +void
     1.9 +ungrabkeys()
    1.10 +{
    1.11 +	static unsigned int len = sizeof(key) / sizeof(key[0]);
    1.12 +	unsigned int i;
    1.13 +	KeyCode code;
    1.14 +
    1.15 +	for(i = 0; i < len; i++) {
    1.16 +		code = XKeysymToKeycode(dpy, key[i].keysym);
    1.17 +		XUngrabKey(dpy, code, key[i].mod, root);
    1.18 +		XUngrabKey(dpy, code, key[i].mod | LockMask, root);
    1.19 +		XUngrabKey(dpy, code, key[i].mod | NUMLOCKMASK, root);
    1.20 +		XUngrabKey(dpy, code, key[i].mod | NUMLOCKMASK | LockMask, root);
    1.21 +	}
    1.22 +}