Re: [dwm] dwm stealing input

From: Stephen Caraher <moskvax_AT_gmail.com>
Date: Fri, 27 Oct 2006 00:34:39 +0930

On 13:33, Thu 26 Oct 06, Anselm R. Garbe wrote:
> On Thu, Oct 26, 2006 at 08:47:56PM +0930, Stephen Caraher wrote:
> > { 0, 0x1008ff12, spawn, { .cmd = "if amixer get PCM,0|grep \"\\[on\\]\" - > /dev/null; then amixer set PCM,0 mute > /dev/null; else amixer set PCM,0 unmute > /dev/null; fi" } }, \
> > { 0 , 0x1008ff11, spawn, { .cmd = "amixer set PCM,0 1-" } }, \
> > { 0 , 0x1008ff13, spawn, { .cmd = "amixer set PCM,0 1+" } }, \
> > { 0 , 0x1008ff14, spawn, { .cmd = "mocp --toggle-pause" } }, \
> > { 0 , 0x1008ff16, spawn, { .cmd = "mocp --previous" } }, \
> > { 0 , 0x1008ff17, spawn, { .cmd = "mocp --next" } }, \
>
> I suspect those lines are not really what you want. 0 is not
> AnyModifier and it might cause your problems. Use AnyModifier
> instead (1<<15).

This whole section of my config was the bascially the result of trial and error,
hence the 0's. I don't know how to program for X, so I tried using 0's to
signify no modifier and it worked.

> Also, your special key definitions look rather
> long, even if KeySym is defined as XID which is a long value,
> but normal KeySym definitions are < 0x0000ffff - your defs
> could cause random behavior if the Xlib implementation makes
> unsafe type casts, so be careful and use the XK_ definitions
> instead (check with xev which key symbol is reported when
> pressing those special keys).

The special keys are the multimedia keys on the front of the Dell Inspiron
6000 laptop, and they don't by default map to any keysyms, only keycodes --
which I now remember I had defined in my .Xmodmap. I've redefined them,
they are:

keycode 160 = XF86AudioMute
keycode 174 = XF86AudioLowerVolume
keycode 176 = XF86AudioRaiseVolume
keycode 162 = XF86AudioPlay
keycode 144 = XF86AudioPrev
keycode 153 = XF86AudioNext
keycode 164 = XF86AudioStop

Those keysyms, of course, don't by default map to any keycodes. With those
mappings back, everything works again. wmii must have somehow been upset by the
dangling keysyms as well, as they are bound to functions in my .wmiirc.

The keysym numbers I have in my config.h are exactly the same as the definitions
of the above keysym names in <X11/XF86keysym.h>. I must have been too scared to
modify dwm's source code at the time I wrote that part of the config, so I was
using the raw numbers instead of including XF86keysym.h in event.c and using the
macros. Regardless of whether or not I keep the numbers or use the macros, this
is what I get upon dwm startup when I use AnyModifier instead of 0:

dwm: fatal error: request code=33, error code=2
X Error of failed request: BadValue (integer parameter out of range for operation)
  Major opcode of failed request: 33 (X_GrabKey)
  Value in failed request: 0x8002
  Serial number of failed request: 216
  Current serial number in output stream: 243

Using 0 works, as it always has.

> And next time recheck such behavior with the default config.h
> first, to make sure it is not related to your config.h.

For some odd reason, I didn't think of doing this, when it ought to have been
the very first thing I did.

Thanks for your help in getting me a functioning dwm again, although it wasn't
dwm's fault anyway, it was mine, and I just needed it to be pointed out to me.

;)

-- 
Stephen Caraher (moskvax) // GPG: C7C4C591

Received on Thu Oct 26 2006 - 17:04:48 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:32:11 UTC