Mercurial > dwm-meillo
diff event.c @ 586:c2ddd15b199e
changing Key.func into Key.func[NFUNCS], this allows sequences execution of functions per keypress (avoids implementing useless masterfunctions which call atomic ones)
author | arg@mig29 |
---|---|
date | Mon, 27 Nov 2006 13:21:38 +0100 |
parents | 601842ee4484 |
children | 732c58a3d92d |
line wrap: on
line diff
--- a/event.c Mon Nov 27 11:05:47 2006 +0100 +++ b/event.c Mon Nov 27 13:21:38 2006 +0100 @@ -11,7 +11,7 @@ typedef struct { unsigned long mod; KeySym keysym; - void (*func)(Arg *arg); + void (*func[NFUNCS])(Arg *arg); Arg arg; } Key; @@ -245,7 +245,7 @@ static void keypress(XEvent *e) { static unsigned int len = sizeof key / sizeof key[0]; - unsigned int i; + unsigned int i, j; KeySym keysym; XKeyEvent *ev = &e->xkey; @@ -254,8 +254,9 @@ if(keysym == key[i].keysym && CLEANMASK(key[i].mod) == CLEANMASK(ev->state)) { - if(key[i].func) - key[i].func(&key[i].arg); + for(j = 0; j < NFUNCS; j++) + if(key[i].func[j]) + key[i].func[j](&key[i].arg); return; } }