From: Vojtech P. <vo...@su...> - 2005-07-05 09:04:44
|
On Mon, Jul 04, 2005 at 04:08:09PM -0400, Micah F. Galizia wrote: > On Mon, 2005-04-07 at 13:01 +0200, Vojtech Pavlik wrote: > > The assignment of HID usages to Linux input events is done in the > > hid-input.c file. Change the #undef DEBUG in there to a #define DEBUG, > > and take a look at (or send me) the resulting 'dmesg' output. There > > you'll see which HID usages it didn't understand and how it assigned the > > others. > > Hello again. > > The output is at the bottom of the message. The offending device is > listed as the "Logitech USB Receiver." > > Another thing I just noticed is that the first physical device, which is > standard keys (numbers, letters, etc), is claiming to have keys and > buttons that it does not (or evtest is anyways). > > In any case, I'm game to fix this, so I guess I'm looking for > recommendations on where to go from here. Oh, and sorry for all of the > extra junk included in the dmesg output: > > Mapping: Keyboard.008c ---> Key.KPJpComma > Mapping: Keyboard.008d ---> Key.Unknown > Mapping: Keyboard.008e ---> Key.Unknown > Mapping: Keyboard.008f ---> Key.Unknown > Mapping: Keyboard.0090 ---> Key.Hanguel > Mapping: Keyboard.0091 ---> Key.Hanja > Mapping: Keyboard.0092 ---> Key.Katakana > Mapping: Keyboard.0093 ---> Key.HIRAGANA > Mapping: Keyboard.0094 ---> Key.Zenkaku/Hankaku > Mapping: Keyboard.0095 ---> Key.Unknown > Mapping: Keyboard.0096 ---> Key.Unknown > Mapping: Keyboard.0097 ---> Key.Unknown > Mapping: Keyboard.0098 ---> Key.Unknown > Mapping: LED.NumLock ---> LED.NumLock > Mapping: LED.CapsLock ---> LED.CapsLock > Mapping: LED.ScrollLock ---> LED.ScrollLock > input: USB HID v1.10 Keyboard [Logitech USB Receiver] on usb-0000:00:10.3-2 The above seems to be a truncated output from the keyboard part of the USB receiver. Apart from claiming to have keys that it doesn't, which is rather common, I don't see any problems there. > Mapping: Consumer.00b5 ---> Key.NextSong > Mapping: Consumer.00b6 ---> Key.PreviousSong > Mapping: Consumer.0045 ---> Key.Btn0 > Mapping: Consumer.00cd ---> Key.PlayPause > Mapping: Consumer.00e2 ---> Key.Mute > Mapping: Consumer.00e9 ---> Key.VolumeUp > Mapping: Consumer.00ea ---> Key.VolumeDown > Mapping: Consumer.00b2 ---> Key.Record > Mapping: Consumer.009c ---> Key.Btn1 > Mapping: Consumer.009d ---> Key.Btn2 > Mapping: Consumer.0224 ---> Key.Back > Mapping: Consumer.0225 ---> Key.Forward > Mapping: Consumer.00b7 ---> Key.StopCD > Mapping: Consumer.0227 ---> Key.Refresh > Mapping: Consumer.022a ---> Key.Bookmarks > Mapping: Consumer.0192 ---> Key.Calc > Mapping: Consumer.0194 ---> Key.File > Mapping: Consumer.0209 ---> Key.Btn3 > Mapping: Consumer.00b4 ---> Key.Rewind > Mapping: Consumer.00b3 ---> Key.Fast Forward > Mapping: Consumer.0223 ---> Key.HomePage > Mapping: Consumer.008d ---> Key.Btn4 > Mapping: Consumer.00b0 ---> Key.Play > Mapping: Consumer.00b1 ---> Key.Pause > Mapping: ffbc.000d ---> Key.Btn5 > Mapping: ffbc.0025 ---> Key.Btn6 > Mapping: ffbc.0024 ---> Key.Btn7 > Mapping: ffbc.0047 ---> Key.Btn8 > Mapping: ffbc.0049 ---> Key.Btn9 > Mapping: ffbc.004a ---> Key.? > Mapping: ffbc.0046 ---> Key.? > Mapping: ffbc.0048 ---> Key.? > Mapping: ffbc.004b ---> Key.? > Mapping: ffbc.004c ---> Key.? > Mapping: ffbc.0026 ---> Key.? > Mapping: ffbc.004d ---> Key.LeftBtn > Mapping: ffbc.0031 ---> Key.RightBtn > Mapping: ffbc.0032 ---> Key.MiddleBtn > Mapping: ffbc.0033 ---> Key.SideBtn > Mapping: ffbc.0004 ---> Key.ExtraBtn > Mapping: ffbc.0051 ---> Key.ForwardBtn > Mapping: ffbc.0052 ---> Key.BackBtn > input,hiddev96: USB HID v1.10 Device [Logitech USB Receiver] on usb-0000:00:10.3-2 Here we have the multimedia part of the thingy, most likely some kind of a remote. And this is where the hid-input module gets quite confused. First by usages from the Consumer page it doesn't understand (0045, 009c, 009d, 0209, 008d). Second, by Logitech vendor usages (ffbc.*). This will be a bit harder, and will need your cooperation. Please enable DEBUG in hid-core.c, too, and check what usages from the ffbc page appear in your syslog/dmesg when you press keys on the device. Let's take a look in the specs (USB HID HUT 1.11): 0045: MenuRight 009c: NextChannel 009d: PrevChannel 0209: ApplicationControlProperties 008d: MediaSelectProgramGuide I guess I'll need your help again to find out what these keys are supposed to do and how they're marked on the device. > usb 1-1: new low speed USB device using uhci_hcd and address 4 > Mapping: Button.0001 ---> Key.LeftBtn > Mapping: Button.0002 ---> Key.RightBtn > Mapping: Button.0003 ---> Key.MiddleBtn > Mapping: Button.0004 ---> Key.SideBtn > Mapping: Button.0005 ---> Key.ExtraBtn > Mapping: Button.0006 ---> Key.ForwardBtn > Mapping: Button.0007 ---> Key.BackBtn > Mapping: Button.0008 ---> Key.TaskBtn > Mapping: GenericDesktop.X ---> Relative.X > Mapping: GenericDesktop.Y ---> Relative.Y > Mapping: GenericDesktop.Wheel ---> Relative.Wheel > Mapping: LED.004b ---> IGNORED > Mapping: LED.004b ---> IGNORED > Mapping: LED.004b ---> IGNORED > Mapping: LED.004b ---> IGNORED > Mapping: LED.004b ---> IGNORED > Mapping: LED.004b ---> IGNORED > Mapping: LED.004b ---> IGNORED > Mapping: LED.004b ---> IGNORED > input: USB HID v1.10 Mouse [Logitech USB-PS/2 Optical Mouse] on usb-0000:00:10.0-1 Apart from claiming to have several LEDs of the same type ("Generic Indicator"), which the hid-input mapper correctly ignores, the mouse is pretty normal. > usb 1-2: new low speed USB device using uhci_hcd and address 5 > Mapping: Keyboard.00e0 ---> Key.LeftControl > Mapping: Keyboard.00e1 ---> Key.LeftShift > Mapping: Keyboard.00e6 ---> Key.RightAlt > Mapping: Keyboard.00e7 ---> Key.RightMeta > Mapping: Keyboard.0000 ---> IGNORED > Mapping: Keyboard.0001 ---> IGNORED > Mapping: Keyboard.0002 ---> IGNORED > Mapping: Keyboard.0003 ---> IGNORED > Mapping: Keyboard.0004 ---> Key.A > Mapping: Keyboard.0005 ---> Key.B > Mapping: Keyboard.006c ---> Key.F17 > Mapping: Keyboard.0071 ---> Key.F22 > Mapping: Keyboard.0072 ---> Key.F23 > Mapping: Keyboard.0073 ---> Key.F24 > Mapping: Keyboard.0074 ---> Key.Open > Mapping: Keyboard.0075 ---> Key.Help > Mapping: Keyboard.0076 ---> Key.Props > Mapping: Keyboard.009d ---> Key.Unknown > Mapping: Keyboard.00a2 ---> Key.Unknown > Mapping: Keyboard.00a3 ---> Key.Unknown > Mapping: Keyboard.00a4 ---> Key.Unknown > Mapping: LED.NumLock ---> LED.NumLock > Mapping: LED.CapsLock ---> LED.CapsLock > Mapping: LED.ScrollLock ---> LED.ScrollLock > Mapping: LED.Compose ---> LED.Compose > Mapping: LED.Kana ---> LED.Kana > input: USB HID v1.10 Keyboard [Logitech Logitech USB Keyboard] on usb-0000:00:10.0-2 And here comes a keyboard, claiming LEDs it likely doesn't have, and a bunch of extra keys, too, but nothing too bad. > Mapping: Consumer.0225 ---> Key.Forward > Mapping: Consumer.00b6 ---> Key.PreviousSong > Mapping: Consumer.00b5 ---> Key.NextSong > Mapping: Consumer.00b7 ---> Key.StopCD > Mapping: Consumer.00cd ---> Key.PlayPause > Mapping: Consumer.00ea ---> Key.VolumeDown > Mapping: Consumer.00e9 ---> Key.VolumeUp > Mapping: Consumer.00e2 ---> Key.Mute > Mapping: Consumer.0192 ---> Key.Calc > Mapping: Consumer.018a ---> Key.Mail > Mapping: Consumer.0221 ---> Key.Find > Mapping: Consumer.0223 ---> Key.HomePage > Mapping: Consumer.022a ---> Key.Bookmarks > Mapping: Consumer.0224 ---> Key.Back > Mapping: Consumer.0183 ---> Key.Config > Mapping: Button.0001 ---> Key.Btn0 [snip] > Mapping: Button.003f ---> Key.BtnThumbR > Mapping: Button.0040 ---> Key.? > Mapping: Consumer.0201 ---> Absolute.Misc > Mapping: Consumer.0289 ---> Absolute.? > Mapping: Consumer.028b ---> Absolute.? > Mapping: Consumer.028c ---> Absolute.? > Mapping: Consumer.021a ---> Key.Undo > Mapping: Consumer.0279 ---> Absolute.? > Mapping: Consumer.0208 ---> Absolute.? > Mapping: Consumer.0207 ---> Absolute.? > Mapping: Consumer.0194 ---> Key.File > Mapping: Consumer.01a7 ---> Absolute.? > Mapping: Consumer.01b6 ---> Absolute.? > Mapping: Consumer.01b7 ---> Absolute.? > Mapping: GenericDesktop.SystemSleep ---> Key.Sleep > Mapping: GenericDesktop.SystemPowerDown ---> Key.Power > Mapping: GenericDesktop.SystemWakeUp ---> Key.WakeUp > Mapping: GenericDesktop.Wheel ---> Relative.Wheel > Mapping: GenericDesktop.X ---> Relative.X > Mapping: GenericDesktop.Y ---> Relative.Y > input: USB HID v1.10 Mouse [Logitech Logitech USB Keyboard] on usb-0000:00:10.0-2 And the second part of the USB keyboard is pretty evil. It claims to be a mouse with 64 buttons, a host of consumer page keys and other controls. 0201: New 0289: Reply 028b: ForwardMsg 028c: Send 0279: Redo 0208: Print 0207: Save 0194: FileBrowser 01a7: Documents 01b6: RESERVED 01b7: RESERVED Please try with this patch: Index: dmitry/include/linux/input.h =================================================================== --- dmitry.orig/include/linux/input.h 2005-07-05 10:58:05.000000000 +0200 +++ dmitry/include/linux/input.h 2005-07-05 10:58:37.000000000 +0200 @@ -287,6 +287,8 @@ #define KEY_SCROLLDOWN 178 #define KEY_KPLEFTPAREN 179 #define KEY_KPRIGHTPAREN 180 +#define KEY_NEW 181 +#define KEY_REDO 182 #define KEY_F13 183 #define KEY_F14 184 @@ -333,6 +335,12 @@ #define KEY_KBDILLUMDOWN 229 #define KEY_KBDILLUMUP 230 +#define KEY_SEND 231 +#define KEY_REPLY 232 +#define KEY_FORWARDMAIL 233 +#define KEY_SAVE 234 +#define KEY_DOCUMENTS 235 + #define KEY_UNKNOWN 240 #define BTN_MISC 0x100 Index: dmitry/drivers/usb/input/hid-input.c =================================================================== --- dmitry.orig/drivers/usb/input/hid-input.c 2005-07-05 10:58:05.000000000 +0200 +++ dmitry/drivers/usb/input/hid-input.c 2005-07-05 11:02:25.000000000 +0200 @@ -77,8 +77,8 @@ { struct input_dev *input = &hidinput->input; struct hid_device *device = hidinput->input.private; - int max, code; - unsigned long *bit; + int max = 0, code; + unsigned long *bit = NULL; field->hidinput = hidinput; @@ -247,7 +247,10 @@ case 0x034: map_key_clear(KEY_SLEEP); break; case 0x036: map_key_clear(BTN_MISC); break; case 0x08a: map_key_clear(KEY_WWW); break; + case 0x08d: map_key_clear(KEY_PROGRAM); break; case 0x095: map_key_clear(KEY_HELP); break; + case 0x09c: map_key_clear(KEY_CHANNELUP); break; + case 0x09d: map_key_clear(KEY_CHANNELDOWN); break; case 0x0b0: map_key_clear(KEY_PLAY); break; case 0x0b1: map_key_clear(KEY_PAUSE); break; case 0x0b2: map_key_clear(KEY_RECORD); break; @@ -267,6 +270,11 @@ case 0x18a: map_key_clear(KEY_MAIL); break; case 0x192: map_key_clear(KEY_CALC); break; case 0x194: map_key_clear(KEY_FILE); break; + case 0x1a7: map_key_clear(KEY_DOCUMENTS); break; + case 0x201: map_key_clear(KEY_NEW); break; + case 0x207: map_key_clear(KEY_SAVE); break; + case 0x208: map_key_clear(KEY_PRINT); break; + case 0x209: map_key_clear(KEY_PROPS); break; case 0x21a: map_key_clear(KEY_UNDO); break; case 0x21b: map_key_clear(KEY_COPY); break; case 0x21c: map_key_clear(KEY_CUT); break; @@ -279,7 +287,11 @@ case 0x227: map_key_clear(KEY_REFRESH); break; case 0x22a: map_key_clear(KEY_BOOKMARKS); break; case 0x238: map_rel(REL_HWHEEL); break; - default: goto unknown; + case 0x279: map_key_clear(KEY_REDO); break; + case 0x289: map_key_clear(KEY_REPLY); break; + case 0x28b: map_key_clear(KEY_FORWARDMAIL); break; + case 0x28c: map_key_clear(KEY_SEND); break; + default: goto ignore; } break; @@ -305,6 +317,7 @@ case HID_UP_MSVENDOR: case HID_UP_LOGIVENDOR: + case HID_UP_LOGIVENDOR2: goto ignore; Index: dmitry/drivers/usb/input/hid-debug.h =================================================================== --- dmitry.orig/drivers/usb/input/hid-debug.h 2005-07-05 10:58:05.000000000 +0200 +++ dmitry/drivers/usb/input/hid-debug.h 2005-07-05 10:58:37.000000000 +0200 @@ -109,6 +109,7 @@ {0, 0x03, "ScrollLock"}, {0, 0x04, "Compose"}, {0, 0x05, "Kana"}, + {0, 0x4b, "GenericIndicator"}, { 9, 0, "Button" }, { 10, 0, "Ordinal" }, { 12, 0, "Consumer" }, @@ -591,7 +592,8 @@ [KEY_EXIT] = "Exit", [KEY_MOVE] = "Move", [KEY_EDIT] = "Edit", [KEY_SCROLLUP] = "ScrollUp", [KEY_SCROLLDOWN] = "ScrollDown", [KEY_KPLEFTPAREN] = "KPLeftParenthesis", - [KEY_KPRIGHTPAREN] = "KPRightParenthesis", [KEY_F13] = "F13", + [KEY_KPRIGHTPAREN] = "KPRightParenthesis", [KEY_NEW] = "New", + [KEY_REDO] = "Redo", [KEY_F13] = "F13", [KEY_F14] = "F14", [KEY_F15] = "F15", [KEY_F16] = "F16", [KEY_F17] = "F17", [KEY_F18] = "F18", [KEY_F19] = "F19", @@ -601,15 +603,15 @@ [KEY_PAUSECD] = "PauseCD", [KEY_PROG3] = "Prog3", [KEY_PROG4] = "Prog4", [KEY_SUSPEND] = "Suspend", [KEY_CLOSE] = "Close", [KEY_PLAY] = "Play", - [KEY_FASTFORWARD] = "Fast Forward", [KEY_BASSBOOST] = "Bass Boost", + [KEY_FASTFORWARD] = "FastForward", [KEY_BASSBOOST] = "BassBoost", [KEY_PRINT] = "Print", [KEY_HP] = "HP", [KEY_CAMERA] = "Camera", [KEY_SOUND] = "Sound", [KEY_QUESTION] = "Question", [KEY_EMAIL] = "Email", [KEY_CHAT] = "Chat", [KEY_SEARCH] = "Search", [KEY_CONNECT] = "Connect", [KEY_FINANCE] = "Finance", [KEY_SPORT] = "Sport", [KEY_SHOP] = "Shop", - [KEY_ALTERASE] = "Alternate Erase", [KEY_CANCEL] = "Cancel", - [KEY_BRIGHTNESSDOWN] = "Brightness down", [KEY_BRIGHTNESSUP] = "Brightness up", + [KEY_ALTERASE] = "AlternateErase", [KEY_CANCEL] = "Cancel", + [KEY_BRIGHTNESSDOWN] = "BrightnessDown", [KEY_BRIGHTNESSUP] = "BrightnessUp", [KEY_MEDIA] = "Media", [KEY_UNKNOWN] = "Unknown", [BTN_0] = "Btn0", [BTN_1] = "Btn1", [BTN_2] = "Btn2", [BTN_3] = "Btn3", @@ -639,8 +641,8 @@ [BTN_TOOL_AIRBRUSH] = "ToolAirbrush", [BTN_TOOL_FINGER] = "ToolFinger", [BTN_TOOL_MOUSE] = "ToolMouse", [BTN_TOOL_LENS] = "ToolLens", [BTN_TOUCH] = "Touch", [BTN_STYLUS] = "Stylus", - [BTN_STYLUS2] = "Stylus2", [BTN_TOOL_DOUBLETAP] = "Tool Doubletap", - [BTN_TOOL_TRIPLETAP] = "Tool Tripletap", [BTN_GEAR_DOWN] = "WheelBtn", + [BTN_STYLUS2] = "Stylus2", [BTN_TOOL_DOUBLETAP] = "ToolDoubleTap", + [BTN_TOOL_TRIPLETAP] = "ToolTripleTap", [BTN_GEAR_DOWN] = "WheelBtn", [BTN_GEAR_UP] = "Gear up", [KEY_OK] = "Ok", [KEY_SELECT] = "Select", [KEY_GOTO] = "Goto", [KEY_CLEAR] = "Clear", [KEY_POWER2] = "Power2", @@ -676,6 +678,9 @@ [KEY_TWEN] = "TWEN", [KEY_DEL_EOL] = "DeleteEOL", [KEY_DEL_EOS] = "DeleteEOS", [KEY_INS_LINE] = "InsertLine", [KEY_DEL_LINE] = "DeleteLine", + [KEY_SEND] = "Send", [KEY_REPLY] = "Reply", + [KEY_FORWARDMAIL] = "ForwardMail", [KEY_SAVE] = "Save", + [KEY_DOCUMENTS] = "Documents", }; static char *relatives[REL_MAX + 1] = { Index: dmitry/drivers/usb/input/hid.h =================================================================== --- dmitry.orig/drivers/usb/input/hid.h 2005-07-05 10:58:05.000000000 +0200 +++ dmitry/drivers/usb/input/hid.h 2005-07-05 10:58:37.000000000 +0200 @@ -184,6 +184,7 @@ #define HID_UP_HPVENDOR 0xff7f0000 #define HID_UP_MSVENDOR 0xff000000 #define HID_UP_LOGIVENDOR 0x00ff0000 +#define HID_UP_LOGIVENDOR2 0xffbc0000 #define HID_USAGE 0x0000ffff -- Vojtech Pavlik SuSE Labs, SuSE CR |