Re: [hackers] [dwm] applied Andreas Amann's patch from Oct 2010, thanks || garbeam

From: Benjamin R. Haskell <suckless_AT_benizi.com>
Date: Mon, 27 Jun 2011 08:16:34 -0400 (EDT)

This kills all my keybindings. I don't know if it's nonstandard, but my
Num_Lock is mapped to mod2 (according to xmodmap). Works fine most
places. And works fine with the, IMO, more straightforward:

#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask))

That is: the clean mask is the bits of the mask other than NumLock and
CapsLock.

(Rather than: the clean mask is these bits of the mask: Shift, Control,
Mod1, Mod2, Mod3, Mod4, and Mod5.)

In the thread where this patch appears, the first patch¹ is about
per-window keyboard layouts. So, it makes sense to reduce the reliance
on a dwm-global variable (numlockmask). Andreas's message for this
patch² reads:

"""
Works well for me. Note however that you cannot switch between tags per
mouse if an alternate layout is activated. The patch below fixes this.
"""

But, it's unclear to me what exact problem relating to switching via
mouse this change would fix. Just the general "different layouts,
different Num_Lock behavior" problem?

For now I've patched this out locally (was kind of fun running `hg diff`
and `vi dwm.c` remotely from my Droid). I've never modified anything
related to Num_Lock, so it's Gentoo's default. Same for OpenSUSE where
it appears to be set initially in xkb's /usr/share/X11/xkb/symbols/pc in
the partial map "pc105":

xkb_symbols "pc105" {
// ...
modifier_map Mod2 { Num_Lock };
// ...
}

I run a keyboard setup script from .xinitrc, so I can easily muck with
my modmap if I'm the weirdo here. But the consistency across Gentoo and
OpenSUSE makes me wonder.

-- 
Best,
Ben
¹: http://lists.suckless.org/dev/1010/6184.html
²: http://lists.suckless.org/dev/1010/6195.html
On Fri, 24 Jun 2011, hg_AT_suckless.org wrote:
> changeset:   1553:79fe8e97dcf7
> tag:         tip
> user:        garbeam_AT_gmail.com
> date:        Fri Jun 24 21:02:32 2011 +0100
> files:       dwm.c
> description:
> applied Andreas Amann's patch from Oct 2010, thanks
>
>
> diff -r faaef3b7272c -r 79fe8e97dcf7 dwm.c
> --- a/dwm.c	Fri Jun 17 20:22:54 2011 +0100
> +++ b/dwm.c	Fri Jun 24 21:02:32 2011 +0100
> @@ -42,7 +42,7 @@
>
> /* macros */
> #define BUTTONMASK              (ButtonPressMask|ButtonReleaseMask)
> -#define CLEANMASK(mask)         (mask & ~(numlockmask|LockMask))
> +#define CLEANMASK(mask)         (mask & (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask))
> #define INRECT(X,Y,RX,RY,RW,RH) ((X) >= (RX) && (X) < (RX) + (RW) && (Y) >= (RY) && (Y) < (RY) + (RH))
> #define ISVISIBLE(C)            ((C->tags & C->mon->tagset[C->mon->seltags]))
> #define LENGTH(X)               (sizeof X / sizeof X[0])
>
>
>
Received on Mon Jun 27 2011 - 14:16:34 CEST

This archive was generated by hypermail 2.2.0 : Mon Jun 27 2011 - 14:24:04 CEST