Bug 1637 - modified keycode with USB keyboard
Summary: modified keycode with USB keyboard
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Input Devices (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: Vojtech Pavlik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-03 06:01 UTC by Lo
Modified: 2004-01-31 15:34 UTC (History)
2 users (show)

See Also:
Kernel Version: 2.6.0-test10
Subsystem:
Regression: ---
Bisected commit-id:


Attachments

Description Lo 2003-12-03 06:01:03 UTC
Distribution: Debian GNU/Linux sid
Hardware Environment: Dell Optiplex GX240 w/ USB keyboard and mouse
Software Environment:
Problem Description: the behaviour of one key has been modified since 2.4.x
kernels (modified keycode)

This problem has been talked about in other bug records. This is a bug
describing exactly the problem.

Bug #1140 (marked as rejected) dealt with this problem, but it seems its author
was very clear, and Vojtech classified it as unusable. But this is not a minor
problem.

Bug #1229 can be about another situation, but comments #11 and #13 are related
to this bug.

First of all, I use a french keyboard. I will talk about the "asterisk" key, but
the key is actually the one next to the enter key, on the same line as the fghjk
keys. It is not a specific nor a "multimedia" key.

Under 2.4.22, in console mode, the key prints "*" as expected. when using
showkey -s, its scancode is 0x2b, ie 43d. The showkey prints 43. This keycode 43
is related to the "*" character in the keymap. Everything is fine.

Under 2.6.0-test10, in console mode, the key doesn't print the "*", but first
exited from the shell. Actually, it was linked to the SAK key (according to the
keymap, with keycode 84). Under X, the key screwed up the keyboard, also because
of the SAK interruption. 

I modified the keymap to have the usual LastConsole binded to the keycode 84.
Now, X is running fine, but in console mode, when I press my asterisk key, I
swith to the last console.

showkey -s still shows scancode 0x2b = 43d, but showkey prints 84, instead of
the expected 43.


Actually, all other keys give the same keycode (with showkey) under 2.4.22 and
2.6.0-test10 *except* this key, that shows keycode 84 instead of 43.


Let's debug a while.

2.4.22 :
"*" key pressed
usage->hid : 0x00070032 (Keyboard.0032) -> 0x32 ie 50d
usage->code : hid_keyboard[50] = 84d
showkey -s : 0x2b = 43d
showkey : 43
keymap : "*"

2.6.0-test10 :
"*" key pressed
usage->hid : 0x00070032 (Keyboard.0032) -> 0x32 ie 50d
usage->code : hid_keyboard[50] = 84d
showkey -s : 0x2b = 43d
showkey : 84 !!!!!!!
keymap : LastConsole or SAK --> screws X (depends of the keymap)

It seems that for many keys the usage->code value is the same as the showkey -s
value. But in this case, they differ (Is it normal ?)


Well, I hope that with this info you could try to fix this bug. What about
modifying the hid_keyboard[50] value to 43 ? It still doesn't explain why the
global behaviour changed since 2.4.x ...

Thanks in advance
Comment 1 Lo 2003-12-04 07:39:36 UTC
To precise my last sentence, if I change the hid_keyboard[50] value from 84 to
43, it actually works fine.

So the questions are :
- if we change this value, could some other keyboards be impacted ?
- is this hid_keyboard table following some specification ? If so, where could I
find it ?
- still, how could we explain the behaviour modification between 2.4.22 and
2.6.0-test10, with the same showkey program ?

FYI : $ showkey -V
showkey: (console-tools) 0.2.3

Thanks
Comment 2 Pekka Pietikainen 2004-01-05 10:27:33 UTC
Some relevant links:

http://testing.lkml.org/slashdot.php?mid=321327

http://www.ussg.iu.edu/hypermail/linux/kernel/0001.0/0214.html
(which explains that scancode 84 is a special "103th" european key for \ and |.

Apparently since it can be a different key from 43 in some layouts, the fix you
recommended might not be the best possible choice (even though it makes things
compatible with 2.4 and works perfectly for me). I've mailed the kbd maintainer
and linux-kernel so maybe this could get sorted out once and for all, it's a
very annoying problem.

Instead, kbd (and XFree86?) should probably be changed to make 84 the same as 43
on all keymaps where there is no difference (Finnish is one, I think this is
pretty much true for all layouts).  Or does this break PS/2 keyboards that do
use 84 for something else?
Comment 3 Vojtech Pavlik 2004-01-31 15:34:05 UTC
Although it's not a perfect fix, in the end I changed the table
in the hid driver to 43, because only USB (and PS/2 Set3) can differentiate
between this 103rd key and backslash.

So consider this fixed.

Note You need to log in before you can comment on or make changes to this bug.