Gentoo Archives: gentoo-desktop

From: "Mike C. Fletcher" <mcfletch@××××××.com>
To: gentoo-desktop@l.g.o
Subject: Re: [gentoo-desktop] Question regarding disappearing keystrokes...
Date: Sun, 26 Sep 2004 04:02:05
In Reply to: [gentoo-desktop] Question regarding disappearing keystrokes... by "Mike C. Fletcher"
Okay, have been playing with this problem (ctrl+shift consumes 
characters) for the last three hours or so (it's been driving me crazy), 
and I now have a solution.  Posting here in case others run into the 
problem and need to know how to disable this little mis-feature.

Problem summary:

    The microsoft(natural) keyboard mapping, by default, maps shift+ctrl
    to "Multi_key", which is a "chording" composition mechanism that
    allows for entering extended character codes via a set of defined
    mappings.  For instance type shift+ctrl, then 'co' produces a
    copyright symbol.  This particular choice of keys, however, means
    that simple editing operations involving shift and control can wind
    up entering the chording-key mode.

Problem source:

    Turns out that this is an XWindows "feature" which was enabled by
    the (AFAIK automatically generated) configuration options in my
    xorg.conf keyboard section:

    Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "keyboard"
        Option      "XkbModel" "microsoftpro"
        Option      "XkbLayout" "us"
        Option      "XkbVariant" "winkeys"

    winkeys doesn't actually appear to be defined anywhere, which leaves
    the definition as the "normal" microsoftpro layout (leaving out
    winkeys, or defining any other unrecognised variant has the same
    effect, effectively selecting "basic").

Solution 1:

    Switch the XkbVariant setting to "nodeadkeys".  This eliminates all
    of the undesirable features of the mapping, but also eliminates a
    number of the commonly useful key-mappings such as the Windows keys,
    the "Menu" key, etceteras.

Solution 2:

    Leave XkbVariant setting as "basic" (or "winkeys" if you prefer). 
    Create a file like this in your home directory:

    8<_____ .xmodmap.rc ___________

        keycode 115 = Super_L Multi_key
        keycode 116 = Super_R Multi_key
        keycode 109 = Control_R

    and add the following line to your .xinitrc file (you may not have a
    .xinitrc file yet, if not, read up on what to put in it, at the very
    least you'll want a call to startkde in it, read this *before*
    editing the file, as a messed up .xinitrc can prevent you from
    logging in (annoying if you're using xdm for your login manager)):

        xmodmap .xmodmaprc

    This file maps the "compose key" (multi-key) mode to
    shift+WindowsKey (either one), and eliminates the control-with-shift
    as a multi-key mapping.

If someone has a better approach, that would be cool to know about too. 
Adding the xmodmap call to .xinitrc means that the whole system operates 
as-desired wrt this feature, but if I'm reading correctly xmodmap is not 
the "proper" way to do this kind of thing any more.

Enjoy yourselves,

Mike C. Fletcher wrote:

> This is probably going to seem trivial, but it is driving me a little > buggy. I'm a programmer, so I spend almost my whole day editing code, > including a large amount of cutting, copying and pasting. So I do a > lot of key-sequences where I'm holding down shift(+ctrl)+arrows to > select, then depressing control to start a ctrl+c or a ctrl+x sequence. >
... <snip> ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder -- gentoo-desktop@g.o mailing list