dwm-meillo
changeset 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 | be40a56df248 |
files | dwm.h event.c main.c |
diffstat | 3 files changed, 18 insertions(+), 0 deletions(-) [+] |
line diff
1.1 --- a/dwm.h Mon Aug 14 10:18:24 2006 +0200 1.2 +++ b/dwm.h Mon Aug 14 10:24:38 2006 +0200 1.3 @@ -108,6 +108,7 @@ 1.4 1.5 /* event.c */ 1.6 extern void grabkeys(); 1.7 +extern void ungrabkeys(); 1.8 1.9 /* main.c */ 1.10 extern int getproto(Window w);
2.1 --- a/event.c Mon Aug 14 10:18:24 2006 +0200 2.2 +++ b/event.c Mon Aug 14 10:24:38 2006 +0200 2.3 @@ -370,3 +370,19 @@ 2.4 GrabModeAsync, GrabModeAsync); 2.5 } 2.6 } 2.7 + 2.8 +void 2.9 +ungrabkeys() 2.10 +{ 2.11 + static unsigned int len = sizeof(key) / sizeof(key[0]); 2.12 + unsigned int i; 2.13 + KeyCode code; 2.14 + 2.15 + for(i = 0; i < len; i++) { 2.16 + code = XKeysymToKeycode(dpy, key[i].keysym); 2.17 + XUngrabKey(dpy, code, key[i].mod, root); 2.18 + XUngrabKey(dpy, code, key[i].mod | LockMask, root); 2.19 + XUngrabKey(dpy, code, key[i].mod | NUMLOCKMASK, root); 2.20 + XUngrabKey(dpy, code, key[i].mod | NUMLOCKMASK | LockMask, root); 2.21 + } 2.22 +}