I have a Microsoft Natural Keyboard Pro. Its extra row of multimedia
and Internet keys work great using PS/2, but misbehave if I switch to
USB. As reported by the X server, several keys' keycodes change and no
longer match up with the proper keysyms. For example, the "My Computer"
key yields keycode 235 when using PS/2, but keycode 111 when using USB.
(Coincidentally, keycode 111 also happens to be the keycode generated by
the "PrintScn" key. That means that there's no combination of xmodmap
magic that can fix this. Once the two keys have the same keycode, it's
beyond fixing.)
I realize that a lot happens between the USB drivers and the X server.
Is what I'm seeing a USB driver bug? A more generic Linux kernel input
layer bug? An X server bug?
I understand that my keyboard appears as two USB devices: one for the
standard keys and one for these extra keys. So at some layer in the
system these are being merged into one stream. Who does that? At what
point do two distinct keys ("My Computer" and "PrintScn") from two
distinct key devices map into a single numeric code (111)? If that's
happening in the X server, then perhaps this is an X server bug. If
that multiplexing is happening below the X server, then it seems the bug
must be down in the kernel.
Suggestions are welcomed, as are polite instructions to report this
elsewhere if it genuinely is someone else's bug.
I'm using an unpatched 2.4.17 kernel. Problem manifests using either
the "usb-uhci" or "uhci" driver. Attached below please find two
documents. The first is the output of /proc/bus/usb/devices, as
requested in the linux-usb FAQ. The second is a comparison chart
showing, for each key, the code reported by the X server when using PS/2
and USB. (I don't know if that's useful, but like I said, I'm not sure
which software layer is responsible for this bug.)
T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2
B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0000 ProdID=0000 Rev= 0.00
S: Product=USB UHCI Root Hub
S: SerialNumber=dc00
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=255ms
T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2
B: Alloc=216/900 us (24%), #Int= 3, #Iso= 0
D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0000 ProdID=0000 Rev= 0.00
S: Product=USB UHCI Root Hub
S: SerialNumber=d800
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=255ms
T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=12 MxCh= 4
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0451 ProdID=1446 Rev= 1.10
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 1 Ivl=255ms
T: Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=1.5 MxCh= 0
D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=045e ProdID=001d Rev= 1.11
S: Product=Microsoft Natural Keyboard Pro
C:* #Ifs= 2 Cfg#= 1 Atr=a0 MxPwr=100mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=01 Driver=hid
E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl= 10ms
I: If#= 1 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=hid
E: Ad=82(I) Atr=03(Int.) MxPS= 3 Ivl= 10ms
Label PS/2 USB
----- ---- ---
Back 234 234
Forward 233 233
Stop 232 232
Refresh 231 121 (mismatch)
Search 229 229
Favorites 230 230
Web/Home 178 130 (mismatch)
Mail 236 236
Mute 160 166 (mismatch)
- (volume) 174 165 (mismatch)
+ (volume) 176 158 (mismatch)
Play/Pause 162 159 (mismatch)
Stop 164 151 (mismatch)
Prev Track 144 164 (mismatch)
Next Track 153 162 (mismatch)
Media 237 129 (mismatch)
My Computer 235 111 (mismatch)
Calculator 161 161
Sleep 223 227 (mismatch)