Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Scancodes, console keycodes and X

2 views
Skip to first unread message

Cameron McCormack

unread,
Apr 13, 2004, 10:40:05 PM4/13/04
to
Hi.

I have a Logitech Cordless MX Duo keyboard whose extra keys I want to
get working in X. I find in the /etc/X11/xkb/symbols/inet file that
there is an entry for the Logitech Cordless Desktop Navigator which
seems to have the same keys as my keyboard. I tried this model and most
of the buttons do generate the correct X key according to xev. Four
buttons do not even register in xev and in fact generate messages at the
console of the form

atkbd.c: Unknown key pressed (translated set 2, code 0xXX on
isa0060/serio0).
atkbd.c: Use 'setkeycodes YYYY <keycode>' to make it known.

where this table states the values for XX and YYYY for the four
unworking keys:

Key XX YYYY
--- -- ----
Messenger 91 e011
Webcam 92 e012
iTouch 93 e013
Shopping 94 e014

So I guess this means that the kernel doesn't know what console keycode
it should generate for these keyboard scancodes. The getkeycodes
program prints out this table for the scancodes and indeed there are
only "0" entries for the four scancodes listed above.

Plain scancodes xx (hex) versus keycodes (dec)
0 is an error; for 1-88 (0x01-0x58) scancode equals keycode

0x58: 88 117 0 0 95 183 184 185
0x60: 0 0 0 0 0 0 0 0
0x68: 0 0 0 0 0 0 0 0
0x70: 93 0 0 89 0 0 85 91
0x78: 90 92 0 94 0 124 121 0

Escaped scancodes e0 xx (hex)

e0 00: 0 0 0 0 0 0 0 0
e0 08: 0 0 0 0 0 0 0 0
e0 10: 165 0 0 0 0 0 0 0
e0 18: 0 163 0 0 96 97 0 0
e0 20: 113 140 164 0 166 0 0 0
e0 28: 0 0 255 0 0 0 114 0
e0 30: 115 0 150 0 0 98 255 99
e0 38: 100 0 0 0 0 0 0 0
e0 40: 0 0 0 0 0 119 119 102
e0 48: 103 104 0 105 112 106 118 107
e0 50: 108 109 110 111 0 0 0 0
e0 58: 0 0 0 125 126 127 116 142
e0 60: 0 0 0 143 0 217 156 173
e0 68: 128 159 158 157 155 226 0 112
e0 70: 0 0 0 0 0 0 0 0
e0 78: 0 0 0 0 0 0 0 0

To get the Messenger button working, I look up the inet file which tells
me that X is expecting the <I11> key. In /etc/X11/xkb/keycodes/xfree86
it says that the keycode for <I11> is 145. So I type this at the
console:

setkeycodes e011 145

I thought this should work, but it doesn't. When I press Messenger, xev
thinks I pressed keycode 112, KP_Divide! In fact, now when I run
"showkey -s" and press the Messenger key, it prints out "0xe0 0x68",
which is not the e011 that the console message told me earlier. But
strangely, "setkeycodes e011 145" did manage to enable that button. In
the getkeycodes table there is only a "0" entry for scancode 0x68.

I found a forum thread about a similar keyboard here[1]. It states that
for the Messenger key, I need to use:

setkeycodes e011 112

With this, when running xev, it tells me key 239 (NoSymbol) was pressed.
This keycode has no mapping in the /etc/X11/xkb/keycodes/xfree86 file.

So under "setkeycodes e011 145", xev thinks I pressed keycode 112, which
just happens to be the same as the number in the "setkeycodes e011 112"
command on that web page. Under "setkeycodes e011 112", xev thinks I
pressed keycode 239.

What's the deal? Why when I change the keycode for this particular
scancode does xev think it's a different keycode? Why does "showkey -s"
display a scancode different from the console message after I run
setkeycodes?

Thanks,

Cameron

[1] http://www.linuxquestions.org/questions/history/125333

--
Cameron McCormack
| Web: http://mcc.id.au/
| ICQ: 26955922

Replies by e-mail must include the current month name in subject line to
bypass spam filter.

Mark Smulders

unread,
Apr 21, 2004, 4:16:15 AM4/21/04
to

> I have a Logitech Cordless MX Duo keyboard whose extra keys I want to
> get working in X.

Have you tried LinEAK?
http://lineak.sf.net

Cheers
Mark

0 new messages