Hi!

I've tried to setup a line like:

bind-key XF86MonBrightnessDown "<cmd>"

in my .cwmrc and the result was that no key event was sent to my windows.

Looking at the code, it looks like XKeysymToKeycode() is returning 0 for
the XF86MonBrightnessDown keysym.  And this means that XGrabKey() will get
'AnyKey' (0) as the keycode.  The patch bellow fixes this.

Cheers,
--
Luís

diff --git app/cwm/conf.c app/cwm/conf.c
index 1e95bd9e12d9..4125aa2aea42 100644
--- app/cwm/conf.c
+++ app/cwm/conf.c
@@ -669,6 +669,8 @@ conf_grab_kbd(Window win)
 
        TAILQ_FOREACH(kb, &Conf.keybindq, entry) {
                kc = XKeysymToKeycode(X_Dpy, kb->press.keysym);
+               if (kc == 0)
+                       continue;
                if ((XkbKeycodeToKeysym(X_Dpy, kc, 0, 0) != kb->press.keysym) &&
                    (XkbKeycodeToKeysym(X_Dpy, kc, 0, 1) == kb->press.keysym))
                        kb->modmask |= ShiftMask;

Reply via email to