about summary refs log tree commit diff stats
path: root/event.c
diff options
context:
space:
mode:
authorarg@mig29 <unknown>2006-11-27 13:21:38 +0100
committerarg@mig29 <unknown>2006-11-27 13:21:38 +0100
commit19390b1a91da680a502ce5acebd086cfbe32627c (patch)
treee068cab66e749c60c352ac6d18ae1abec8466b05 /event.c
parent8dc86051df197792d35521743cc2cb72b60a47ff (diff)
downloaddwm-19390b1a91da680a502ce5acebd086cfbe32627c.tar.gz
changing Key.func into Key.func[NFUNCS], this allows sequences execution of functions per keypress (avoids implementing useless masterfunctions which call atomic ones)
Diffstat (limited to 'event.c')
-rw-r--r--event.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/event.c b/event.c
index edfcc52..45a21a6 100644
--- a/event.c
+++ b/event.c
@@ -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 @@ expose(XEvent *e) {
 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 @@ keypress(XEvent *e) {
 		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;
 		}
 	}