[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: keyboard keycodes (squeeze)



David Emerson wrote:
> I've just purchased an external keyboard for my laptop, and the
> keycodes reported by xev (and showkey on VT) are not as expected.

I don't know but no one else has responded so I might as well include
some information.

> The keyboard is an IBM SK-8840; the laptop is an IBM Thinkpad, with
> a very similar keyboard. Both keyboards include two extra keys by
> the arrow keys, designated "back" and "forward". These work great on
> the built-in keyboard: showkey reports keycodes 158 and 159, which I
> can map however I like in X11.

I have looked at that keyboard, and the one without the touchpad,
myself a few times.  It would be nice to have the same keyboard both
on my laptop and on my desktop.

> However, I am not receiving those keycodes from the external
> keyboard. I am getting Alt_L + Left arrow (back) and Alt_L + Right
> arrow (forward). In showkey this corresponds to codes 105 and 106
> respectively, along with Alt_L, code 56.

I have seen something similar with other keyboards that I have used.
Unfortunately I don't think it is that unusual for different keyboards
to implement different keycodes from either other for some of the
peripheral keys.  In particular my T60p laptop has different keycodes
for Alt_R, Menu, Cntrl_R than my PC105 desktop keyboard.

> Is there something in the kernel that could be doing this? Maybe
> something in udev, or ... I don't know?

First, I don't know.  But as a hint of where to look next I would log
into the linux text console (not under X) and start there.  Then after
getting it fixed then try it under X.  Because it seems that if it
works from the kernel that it might just work under X without doing
anything more.

On the Linux console I would start with dumpkeys.  It has been a while
since I have used this and I forget if options are needed or not.  You
will need to read the docs.  Then examine the resulting key dump file.
Compare the dumped file with the keycodes that you want.  Edit the
file in order to adjust your dump to match what you want.  I would
create a file that only sets what you want and not the entire dump.
For your keys it should be just a few lines.  Then use loadkeys to
load the custom keymap file.  (I do this as a matter of course to make
a custom key layout for me.)

Then under X Windows I would use 'xmodmap -pke' to do basically the
same thing but for X.  Dump the file.  Examine the current map.  Make
an xmodmap file that contains just the keys you want to adjust.  It is
simpler later to know what you are changing if the file only contains
the changes you wish to make.  The load it with xmodmap -l.

Good luck!
Bob

Attachment: signature.asc
Description: Digital signature


Reply to: