09-08-07 06:26 AM
On Fri, 07 Sep 2007 16:19:00 +0000, Dances With Crows wrote:
> Mark Healey staggered into the Black Sun and said:
>
> Fire up xev and take a look at the keycodes reported when you push
> {various modifiers}+BkSpace. IBM Thinkpads use a strange keycode for
> NumLock; Shift+ScrollLock produces keycode 77, which you have to xmodmap
> to NumLock.
>
>
> If something (shift or alt) together with backspace produces a keycode
> different from the normal backspace keycode, all you should have to do
> is find that keycode and do "xmodmap -e 'keycode NN = NumLock' ". Once
> you've figured that out, have something that runs at your WM/DE startup
> execute that xmodmap command.
Here are the some of the relevant lines from -pke:
keycode 22 = BackSpace Terminate_Server
I happen to know that the Terminate_Server is sent when one hits Ctrl-Alt-
Backspace.
keycode 31 = i I iacute Iacute iacute Iacute
The iacute and Iacutes are sent then the I key is chorded with Alt Gr.
When you look at some of the keypad lines:
keycode 88 = KP_Down KP_2
keycode 77 = Num_Lock Pointer_EnableKeys
The two values in each line above are determined by the numlock state
(mod2).
Obviously the output of -pke doesn't make explicit whick keycode is sent
defined by which modifiers are relevant.
>
> This should happen automagically if the keyboard's behaving properly. At
> least it did on all the Thinkpads with NumLock that I've had.
This keyboard is 20 years old. Laptop keyboards and new desktop space
savers do this by sending different scan codes for the relevant keys when
in numlock mode (0x16 and 0x96 when in numlock and 0x4b and 0xcb when not
(or the other way around, I forgot)). Old keyboards don't do that so I
need to do it in software.
What I'd like to do is have Alt Gr-Backspace send a Num_Lock when numlock
is off and Pointer_Enable_Keys when numlock is on.
And then I'd like to have the numeric U key send a 4 or a KP_4 when
numlock is on and the normal values depending on the state of shift and
Alt Gr otherwise.
--
Mark Healey
marknews@healeyopolis.com
[ Post a follow-up to this message ]
|