dwm-meillo

diff wm.c @ 8:7066ff2fe8bc

added key handling
author Anselm R. Garbe <garbeam@wmii.de>
date Tue, 11 Jul 2006 11:50:18 +0200
parents 49e2fc9fb94f
children d567f430a81d
line diff
     1.1 --- a/wm.c	Tue Jul 11 11:27:56 2006 +0200
     1.2 +++ b/wm.c	Tue Jul 11 11:50:18 2006 +0200
     1.3 @@ -24,7 +24,6 @@
     1.4  
     1.5  char *bartext, tag[256];
     1.6  int screen, sel_screen;
     1.7 -unsigned int lock_mask, numlock_mask;
     1.8  
     1.9  /* draw structs */
    1.10  Brush brush = {0};
    1.11 @@ -144,32 +143,6 @@
    1.12  }
    1.13  
    1.14  static void
    1.15 -init_lock_keys()
    1.16 -{
    1.17 -	XModifierKeymap *modmap;
    1.18 -	KeyCode numlock;
    1.19 -	int i;
    1.20 -	static int masks[] = {
    1.21 -		ShiftMask, LockMask, ControlMask, Mod1Mask,
    1.22 -		Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask
    1.23 -	};
    1.24 -
    1.25 -	numlock_mask = 0;
    1.26 -	modmap = XGetModifierMapping(dpy);
    1.27 -	numlock = XKeysymToKeycode(dpy, XStringToKeysym("Num_Lock"));
    1.28 -
    1.29 -	if(modmap && modmap->max_keypermod > 0) {
    1.30 -		int max = (sizeof(masks) / sizeof(int)) * modmap->max_keypermod;
    1.31 -		for(i = 0; i < max; i++)
    1.32 -			if(numlock && (modmap->modifiermap[i] == numlock))
    1.33 -				numlock_mask = masks[i / modmap->max_keypermod];
    1.34 -	}
    1.35 -	XFreeModifiermap(modmap);
    1.36 -
    1.37 -	lock_mask = 255 & ~(numlock_mask | LockMask);
    1.38 -}
    1.39 -
    1.40 -static void
    1.41  cleanup()
    1.42  {
    1.43  	/*
    1.44 @@ -243,7 +216,7 @@
    1.45  	cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing);
    1.46  	cursor[CurMove] = XCreateFontCursor(dpy, XC_fleur);
    1.47  
    1.48 -	init_lock_keys();
    1.49 +	update_keys();
    1.50  
    1.51  	brush.drawable = XCreatePixmap(dpy, root, rect.width, rect.height,
    1.52  			DefaultDepth(dpy, screen));