From: Enno Boland (tox) Date: Mon, 7 Sep 2009 13:43:18 +0000 (+0200) Subject: fixing numlock bug. X-Git-Url: https://git.danieliu.xyz/?a=commitdiff_plain;h=38d809ce59fd4e7f041de3851be27f5a08278cf9;p=surf.git fixing numlock bug. --- diff --git a/surf.c b/surf.c index 3b09f06..b739acd 100644 --- a/surf.c +++ b/surf.c @@ -17,6 +17,7 @@ #include #define LENGTH(x) (sizeof x / sizeof x[0]) +#define CLEANMASK(mask) (mask & ~(GDK_MOD2_MASK)) Display *dpy; Atom urlprop; @@ -276,7 +277,8 @@ keypress(GtkWidget* w, GdkEventKey *ev, Client *c) { focus = BROWSER; for(i = 0; i < LENGTH(keys); i++) { if(focus & keys[i].focus && ev->keyval == keys[i].keyval && - (ev->state == keys[i].mod || ev->state & keys[i].mod) + (CLEANMASK(ev->state) == keys[i].mod || + CLEANMASK(ev->state) & keys[i].mod) && keys[i].func) { keys[i].func(c, &(keys[i].arg)); processed = TRUE;