X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=event.c;h=4e115523b6b7d38fce0a39faad8231ebc136fe9a;hb=99964398e7e7e8b23952f7f1997bf78d1afa8e7b;hp=45a21a661b76fc9f208a134ac9f8406e3b7395b4;hpb=19390b1a91da680a502ce5acebd086cfbe32627c;p=dwm.git diff --git a/event.c b/event.c index 45a21a6..4e11552 100644 --- a/event.c +++ b/event.c @@ -11,7 +11,7 @@ typedef struct { unsigned long mod; KeySym keysym; - void (*func[NFUNCS])(Arg *arg); + void (*func)(Arg *arg); Arg arg; } Key; @@ -245,7 +245,7 @@ expose(XEvent *e) { static void keypress(XEvent *e) { static unsigned int len = sizeof key / sizeof key[0]; - unsigned int i, j; + unsigned int i; KeySym keysym; XKeyEvent *ev = &e->xkey; @@ -254,10 +254,8 @@ keypress(XEvent *e) { if(keysym == key[i].keysym && CLEANMASK(key[i].mod) == CLEANMASK(ev->state)) { - for(j = 0; j < NFUNCS; j++) - if(key[i].func[j]) - key[i].func[j](&key[i].arg); - return; + if(key[i].func) + key[i].func(&key[i].arg); } } }