I'm one of those from the old days that still like to use the directional keys on the numpad instead of directional keys left of the numpad.

That works most of the time, but X has some stupid mistake that confuses Shift with numlock.

When I press and hold shift and push one of the directional keys, it assumes I want the number of that key, instead of moving in that direction, so when I press shift + right, I get a 6, while I was just trying to expand my selection to the right. And that should only happen when numlock is on. It happens the other way around when I press numlock, making numlock act as an alternative capslock for the numpad. IMHO that is completely wrong.

In my opinion, "Shift + keypad = number" is a really stupid behavior... if I want to type a few numbers, I use the row of 1234567890... if I want to type a lot of numbers, I switch on numlock and use the keypad... why Shift?

I found a partial solution, which not only disable the effect of capslock on keypad, but disable the effect of numlock as well

Just put this into ~/.xmodmap

Code:

keycode 0x4F = KP_Home
keycode 0x50 = KP_Up

snip..

This style of xmodmap code is usually A Bad Idea. The problem is that it will only work for your current keyboard - and possibly even your current version of XFree86. It will definitely break if you use VNC.

A better way of doing these things is:

Code:

keysym KP_7 = KP_Home
keysym KP_8 = KP_Up

etc.

To answer the original question, though: what you want is supported by X, at least using xmodmap. I don't know much about the X keyboard extension (XKb) unfortunately.

The keypad normally has two symbols for each key; that is:

Code:

7: KP_Home KP_7
8: KP_Up KP_8

and so forth. The shift key, of course, selects the second symbol. NumLock reverses the behavior, so the second symbol is selected when unshifted. There is no way to have the keypad ignore the shift key.

This behaviour is the same on Windows (and even in MS-DOS), for the most part.

It would be possible, however, to get a program to trap NumLock presses and dynamically change the keymap; I just whipped up a little program (54 lines) that can do this for you:

First off, most applications can be set up with their own meanings for the numeric pad keys (or any other keys, for that matter). Older applications, like xterm, use the Intrinsics translation mechanism. Newer applications use different mechanism; KDE's konsole, for example, uses a key table (various key tables can be found in <KDE>/share/apps/konsole/). Gnome applications presumably have their own mechanism; I don't use Gnome apps that much, though, so I'm not familiar with them.

However, the solution (hack!) I gave changes the numeric keypad for *everything*.

An interesting thing to note about this keyboard is that the shifted keys are, technically, neither the number nor the control. Sun's keyboard mappings are wierd in general, though. (For example, F11 is not F11 but SunF35; this is because F11 didn't exist on early Sun keyboards, so it was assigned to a key labeled Stop on the left side of the Sun keyboard).