Re: NumLock in X

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Victor Odhner
Date:  
To: plug-discuss
Subject: Re: NumLock in X
OK, since none of you slackers out there answered this gripe, I fixed it
myself. ;-)

To restate the problem more clearly, based on my research:
* There is an X convention that the shift key overrides the NumLock key.
* This makes it impossible to select text using shifted numeric-keypad
arrows.

I am biased by the following facts:
* I use this feature all the time, for all text copy/cut/paste/delete
operations, rarely needing the mouse.
* I learned to use the numeric keypad for cursor positioning, before
other arrow keys existed.
* I prefer this because the Home/End/Page/Ins/Del keys are logically
positioned around the arrows.

Below is an easy hack so that the shift key has no effect at all on the
numeric keypad, yet Thunderbird and gedit (at least) recognize when I
have the shift key down so selections work just fine.

I found the file to be hacked on this page:
<http://anakin.ncst.ernet.in/~aparna/consolidated/x1740.html>

And my philosophical view of the problem was clarified by this page:
<http://www.xfree86.org/pipermail/forum/2003-August/003780.html>

The file in question is in the xkb directory, normally /etc/X11/xkb.
Before the hack, /etc/X11/xkb/types/basic contained this entry for the 
numeric keypad:
    type "KEYPAD" {
        modifiers = Shift+NumLock;
        map[None] = Level1;
        map[Shift] = Level2;
        map[NumLock] = Level2;
        map[Shift+NumLock] = Level1;
        level_name[Level1] = "Base";
        level_name[Level2] = "Number";
    };


I modified it to remove the Shift key from any influence on the numeric 
keypad:
    type "KEYPAD" {
        // modifiers = Shift+NumLock;   DISABLED - Shift not a factor.
        modifiers = NumLock;
        map[None] = Level1;
        // map[Shift] = Level2;    DISABLED - Shift not a factor.
        map[NumLock] = Level2;
        // map[Shift+NumLock] = Level1;   THIS WAS THE CULPRIT.  Gotcha!
        level_name[Level1] = "Base";
        level_name[Level2] = "Number";
    };


Interesting note on the side: The rdesktop package does not use xkb but
only "keysyms", which are blind to some of the irritating distinctions,
and my keyboarding style worked fine when going through rdesktop to a
Windows box.

Vic

---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss