* See LICENSE file for license details.
*/
-enum { Tfnord, Tdev, Tnet, Twork, Tmisc, TLast };
#define DEFMODE dotile /* dofloat */
-#define DEFTAG Tdev
#define FONT "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*"
#define BGCOLOR "#0a2c2d"
#define FGCOLOR "#ddeeee"
#define NUMLOCKMASK Mod2Mask
#define MASTERW 52 /* percent */
+enum { Tfnord, Tdev, Tnet, Twork, Tmisc, TLast };
#define TAGS \
char *tags[TLast] = { \
[Tfnord] = "fnord", \
[Twork] = "work", \
[Tmisc] = "misc", \
};
+#define DEFTAG Tdev
#define KEYS \
const char *browse[] = { "firefox", NULL }; \
* See LICENSE file for license details.
*/
-enum { Tfnord, Tdev, Tnet, Twork, Tmisc, TLast };
#define DEFMODE dotile /* dofloat */
-#define DEFTAG Tdev
#define FONT "fixed"
#define BGCOLOR "#666699"
#define FGCOLOR "#eeeeee"
#define NUMLOCKMASK Mod2Mask
#define MASTERW 52 /* percent */
+enum { Tfnord, Tdev, Tnet, Twork, Tmisc, TLast };
#define TAGS \
char *tags[TLast] = { \
[Tfnord] = "fnord", \
[Twork] = "work", \
[Tmisc] = "misc", \
};
+#define DEFTAG Tdev
#define KEYS \
const char *term[] = { "xterm", NULL }; \
KEYS
-static unsigned int valid_mask = 255 & ~(NUMLOCKMASK | LockMask);
+#define CLEANMASK(mask) (mask & ~(NUMLOCKMASK | LockMask))
static void
movemouse(Client *c)
unsigned int i;
KeySym keysym;
XKeyEvent *ev = &e->xkey;
- ev->state &= valid_mask;
keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0);
for(i = 0; i < len; i++)
- if((keysym == key[i].keysym) && ((key[i].mod & valid_mask) == ev->state)) {
+ if(keysym == key[i].keysym &&
+ CLEANMASK(key[i].mod) == CLEANMASK(ev->state)) {
if(key[i].func)
key[i].func(&key[i].arg);
return;
for(i = 0; i < len; i++) {
code = XKeysymToKeycode(dpy, key[i].keysym);
+ /* normal */
XUngrabKey(dpy, code, key[i].mod, root);
- XUngrabKey(dpy, code, key[i].mod | NUMLOCKMASK, root);
- XUngrabKey(dpy, code, key[i].mod | NUMLOCKMASK | LockMask, root);
XGrabKey(dpy, code, key[i].mod, root, True,
GrabModeAsync, GrabModeAsync);
+ /* capslock */
+ XUngrabKey(dpy, code, key[i].mod | LockMask, root);
+ XGrabKey(dpy, code, key[i].mod | LockMask, root, True,
+ GrabModeAsync, GrabModeAsync);
+ /* numlock */
+ XUngrabKey(dpy, code, key[i].mod | NUMLOCKMASK, root);
XGrabKey(dpy, code, key[i].mod | NUMLOCKMASK, root, True,
GrabModeAsync, GrabModeAsync);
+ /* capslock & numlock */
+ XUngrabKey(dpy, code, key[i].mod | NUMLOCKMASK | LockMask, root);
XGrabKey(dpy, code, key[i].mod | NUMLOCKMASK | LockMask, root, True,
GrabModeAsync, GrabModeAsync);
}