1

My Logitech Wave Cordless keyboard presents itself as two devices to the kernel. One is a regular keyboard which works fine, but all the additional keys appear as an event-mouse, such that

cat /dev/input/by-id/usb-Logitech_USB_Receiver-if01-event-mouse

produces the expected garbage when the buttons are pressed, but xev doesn't register anything at all. I've tried hidpoint which doesn't want to run on OpenSuse Tumbleweed, and I've tried usbhid.quirks=0x46d:0xc517:0x40 on the kernel parameters to force 'multi-identity' recognition, but I'm out of my depth at this point so may well not properly understand what I'm doing

Any suggestions about how best to persuade the kernel to recognise the extra device as a keyboard rather than a mouse?

Further info as requested:

lsusb: Bus 001 Device 007: ID 046d:c517 Logitech, Inc. LX710 Cordless Desktop Laser

dmsg: usb 1-6: new low-speed USB device number 7 using xhci_hcd usb 1-6: New USB device found, idVendor=046d, idProduct=c517 usb 1-6: New USB device strings: Mfr=1, Product=2, SerialNumber=0 usb 1-6: Product: USB Receiver usb 1-6: Manufacturer: Logitech input: Logitech USB Receiver as /devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6:1.0/0003:046D:C517.0009/input/input14 logitech 0003:046D:C517.0009: input,hidraw3: USB HID v1.10 Keyboard [Logitech USB Receiver] on usb-0000:00:14.0-6/input0 logitech 0003:046D:C517.000A: fixing up Logitech keyboard report descriptor input: Logitech USB Receiver as /devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6:1.1/0003:046D:C517.000A/input/input15 logitech 0003:046D:C517.000A: input,hiddev0,hidraw4: USB HID v1.10 Mouse [Logitech USB Receiver] on usb-0000:00:14.0-6/input1

$ evtest /dev/input/by-id/usb-Logitech_USB_Receiver-if01-event-mouse > evtestdump

Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x46d product 0xc517 version 0x110
Input device name: "Logitech USB Receiver"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 1 (KEY_ESC)
    Event code 28 (KEY_ENTER)
    Event code 74 (KEY_KPMINUS)
    Event code 78 (KEY_KPPLUS)
    Event code 103 (KEY_UP)
...
    Event code 241 (KEY_VIDEO_NEXT)
    Event code 244 (KEY_BRIGHTNESS_ZERO)
    Event code 256 (BTN_0)
    Event code 272 (BTN_LEFT)
    Event code 273 (BTN_RIGHT)
    Event code 274 (BTN_MIDDLE)
    Event code 275 (BTN_SIDE)
    Event code 276 (BTN_EXTRA)
    Event code 277 (BTN_FORWARD)
    Event code 278 (BTN_BACK)
    Event code 279 (BTN_TASK)
    Event code 352 (KEY_OK)
    Event code 353 (KEY_SELECT)
    Event code 354 (KEY_GOTO)
    Event code 358 (KEY_INFO)
    Event code 362 (KEY_PROGRAM)
    Event code 366 (KEY_PVR)
    Event code 370 (KEY_SUBTITLE)
    Event code 371 (KEY_ANGLE)
    Event code 372 (KEY_ZOOM)
    Event code 374 (KEY_KEYBOARD)
    Event code 376 (KEY_PC)
    Event code 377 (KEY_TV)
    Event code 378 (KEY_TV2)
...
    Event code 431 (KEY_DISPLAYTOGGLE)
    Event code 432 (KEY_SPELLCHECK)
    Event code 433 (KEY_LOGOFF)
    Event code 439 (KEY_MEDIA_REPEAT)
    Event code 442 (KEY_IMAGES)
    Event code 478 (KEY_FN_1)
    Event code 479 (KEY_FN_2)
    Event code 576 (KEY_BUTTONCONFIG)
    Event code 577 (KEY_TASKMANAGER)
    Event code 578 (KEY_JOURNAL)
    Event code 579 (KEY_CONTROLPANEL)
    Event code 580 (KEY_APPSELECT)
    Event code 581 (KEY_SCREENSAVER)
    Event code 582 (KEY_VOICECOMMAND)
    Event code 592 (KEY_BRIGHTNESS_MIN)
    Event code 593 (KEY_BRIGHTNESS_MAX)
    Event code 608 (KEY_KBDINPUTASSIST_PREV)
    Event code 609 (KEY_KBDINPUTASSIST_NEXT)
    Event code 610 (KEY_KBDINPUTASSIST_PREVGROUP)
    Event code 611 (KEY_KBDINPUTASSIST_NEXTGROUP)
    Event code 612 (KEY_KBDINPUTASSIST_ACCEPT)
    Event code 613 (KEY_KBDINPUTASSIST_CANCEL)
  Event type 2 (EV_REL)
    Event code 0 (REL_X)
    Event code 1 (REL_Y)
    Event code 6 (REL_HWHEEL)
    Event code 7 (REL_DIAL)
    Event code 8 (REL_WHEEL)
  Event type 3 (EV_ABS)
    Event code 32 (ABS_VOLUME)
      Value      0
      Min        1
      Max     4173
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
Properties:
Testing ... (interrupt to exit)
Event: time 1498324926.500910, type 4 (EV_MSC), code 4 (MSC_SCAN), value c101c
Event: time 1498324926.500910, type 1 (EV_KEY), code 154 (KEY_CYCLEWINDOWS), value 1
Event: time 1498324926.500910, -------------- SYN_REPORT ------------
Event: time 1498324926.644944, type 4 (EV_MSC), code 4 (MSC_SCAN), value c101c
Event: time 1498324926.644944, type 1 (EV_KEY), code 154 (KEY_CYCLEWINDOWS), value 0
Event: time 1498324926.644944, -------------- SYN_REPORT ------------
Event: time 1498324926.932933, type 4 (EV_MSC), code 4 (MSC_SCAN), value c101f
Event: time 1498324926.932933, type 1 (EV_KEY), code 419 (KEY_ZOOMOUT), value 1
Event: time 1498324926.932933, -------------- SYN_REPORT ------------
Event: time 1498324927.052921, type 4 (EV_MSC), code 4 (MSC_SCAN), value c101f
Event: time 1498324927.052921, type 1 (EV_KEY), code 419 (KEY_ZOOMOUT), value 0
Event: time 1498324927.052921, -------------- SYN_REPORT ------------
Event: time 1498324927.396932, type 4 (EV_MSC), code 4 (MSC_SCAN), value c1020
Event: time 1498324927.396932, type 1 (EV_KEY), code 418 (KEY_ZOOMIN), value 1
Event: time 1498324927.396932, -------------- SYN_REPORT ------------
Event: time 1498324927.548930, type 4 (EV_MSC), code 4 (MSC_SCAN), value c1020
Event: time 1498324927.548930, type 1 (EV_KEY), code 418 (KEY_ZOOMIN), value 0
Event: time 1498324927.548930, -------------- SYN_REPORT ------------
Event: time 1498324927.916944, type 4 (EV_MSC), code 4 (MSC_SCAN), value c103d
Event: time 1498324927.916944, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 1
Event: time 1498324927.916944, -------------- SYN_REPORT ------------
Event: time 1498324928.084925, type 4 (EV_MSC), code 4 (MSC_SCAN), value c103d
Event: time 1498324928.084925, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 0
Event: time 1498324928.084925, -------------- SYN_REPORT ------------
Event: time 1498324928.460914, type 4 (EV_MSC), code 4 (MSC_SCAN), value c1005
Event: time 1498324928.460914, type 1 (EV_KEY), code 212 (KEY_CAMERA), value 1
Event: time 1498324928.460914, -------------- SYN_REPORT ------------
Event: time 1498324928.628903, type 4 (EV_MSC), code 4 (MSC_SCAN), value c1005
Event: time 1498324928.628903, type 1 (EV_KEY), code 212 (KEY_CAMERA), value 0
Event: time 1498324928.628903, -------------- SYN_REPORT ------------
Event: time 1498324930.876924, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00b6
Event: time 1498324930.876924, type 1 (EV_KEY), code 165 (KEY_PREVIOUSSONG), value 1
Event: time 1498324930.876924, -------------- SYN_REPORT ------------
Event: time 1498324930.908915, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00b6
Event: time 1498324930.908915, type 1 (EV_KEY), code 165 (KEY_PREVIOUSSONG), value 0
Event: time 1498324930.908915, -------------- SYN_REPORT ------------
Event: time 1498324931.684927, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00b5
Event: time 1498324931.684927, type 1 (EV_KEY), code 163 (KEY_NEXTSONG), value 1
Event: time 1498324931.684927, -------------- SYN_REPORT ------------
Event: time 1498324931.724935, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00b5
Event: time 1498324931.724935, type 1 (EV_KEY), code 163 (KEY_NEXTSONG), value 0
Event: time 1498324931.724935, -------------- SYN_REPORT ------------
Event: time 1498324932.652916, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0183
Event: time 1498324932.652916, type 1 (EV_KEY), code 226 (KEY_MEDIA), value 1
Event: time 1498324932.652916, -------------- SYN_REPORT ------------
Event: time 1498324932.812954, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0183
Event: time 1498324932.812954, type 1 (EV_KEY), code 226 (KEY_MEDIA), value 0
Event: time 1498324932.812954, -------------- SYN_REPORT ------------
Event: time 1498324933.748907, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0192
Event: time 1498324933.748907, type 1 (EV_KEY), code 140 (KEY_CALC), value 1
Event: time 1498324933.748907, -------------- SYN_REPORT ------------
Event: time 1498324933.884934, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0192
Event: time 1498324933.884934, type 1 (EV_KEY), code 140 (KEY_CALC), value 0
Event: time 1498324933.884934, -------------- SYN_REPORT ------------
Event: time 1498324938.084936, type 4 (EV_MSC), code 4 (MSC_SCAN), value 10082
Event: time 1498324938.084936, type 1 (EV_KEY), code 142 (KEY_SLEEP), value 1
Event: time 1498324938.084936, -------------- SYN_REPORT ------------
Event: time 1498324938.100912, type 4 (EV_MSC), code 4 (MSC_SCAN), value 10082
Event: time 1498324938.100912, type 1 (EV_KEY), code 142 (KEY_SLEEP), value 0
Event: time 1498324938.100912, -------------- SYN_REPORT ------------

(II) config/udev: Adding input device Logitech USB Receiver (/dev/input/mouse1)
(**) Logitech USB Receiver: Applying InputClass "system-keyboard"
(**) Logitech USB Receiver: Applying InputClass "Logitech USB TrackBall"
(**) Logitech USB Receiver: Applying InputClass "Logitech M570 Trackball"
(II) Using input driver 'evdev' for 'Logitech USB Receiver'
(**) Option "SendCoreEvents" "true"
(**) Logitech USB Receiver: always reports core events
(**) evdev: Logitech USB Receiver: Device: "/dev/input/by-id/usb-Logitech_USB_Receiver-if02-event-mouse"
(WW) evdev: Logitech USB Receiver: device file is duplicate. Ignoring.
(EE) PreInit returned 8 for "Logitech USB Receiver"
(II) UnloadModule: "evdev"
(II) config/udev: Adding input device Logitech USB Receiver (/dev/input/event11)
(**) Logitech USB Receiver: Applying InputClass "evdev keyboard catchall"
(**) Logitech USB Receiver: Applying InputClass "system-keyboard"
(**) Logitech USB Receiver: Applying InputClass "evdev keyboard catchall"
(**) Logitech USB Receiver: Applying InputClass "libinput keyboard catchall"
(II) Using input driver 'libinput' for 'Logitech USB Receiver'
(**) Logitech USB Receiver: always reports core events
(**) Option "Device" "/dev/input/event11"
(**) Option "_source" "server/udev"
(II) event11 - (II) Logitech USB Receiver: (II) is tagged by udev as: Keyboard
(II) event11 - (II) Logitech USB Receiver: (II) device is a keyboard
(II) event11 - (II) Logitech USB Receiver: (II) device removed
(**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6:1.0/0003:046D:C517.000D/input/input18/event11"
(II) XINPUT: Adding extended input device "Logitech USB Receiver" (type: KEYBOARD, id 11)
(**) Option "xkb_model" "microsoftpro"
(**) Option "xkb_layout" "gb"
(**) Option "xkb_options" "terminate:ctrl_alt_bksp"
(II) event11 - (II) Logitech USB Receiver: (II) is tagged by udev as: Keyboard
(II) event11 - (II) Logitech USB Receiver: (II) device is a keyboard
(II) config/udev: Adding input device Logitech USB Receiver (/dev/input/event12)
(**) Logitech USB Receiver: Applying InputClass "evdev pointer catchall"
(**) Logitech USB Receiver: Applying InputClass "evdev keyboard catchall"
(**) Logitech USB Receiver: Applying InputClass "system-keyboard"
(**) Logitech USB Receiver: Applying InputClass "evdev pointer catchall"
(**) Logitech USB Receiver: Applying InputClass "evdev keyboard catchall"
(**) Logitech USB Receiver: Applying InputClass "Logitech USB TrackBall"
(**) Logitech USB Receiver: Applying InputClass "Logitech M570 Trackball"
(**) Logitech USB Receiver: Applying InputClass "libinput pointer catchall"
(**) Logitech USB Receiver: Applying InputClass "libinput keyboard catchall"
(II) Using input driver 'libinput' for 'Logitech USB Receiver'
(**) Option "SendCoreEvents" "true"
(**) Logitech USB Receiver: always reports core events
(**) Option "Device" "/dev/input/by-id/usb-Logitech_USB_Receiver-if02-event-mouse"
(**) Option "_source" "server/udev"
(EE) Failed to look up path '/dev/input/event13'
(II) event13: opening input device '/dev/input/event13' failed (No such device).
(II) event13 - failed to create input device '/dev/input/event13'.
(EE) libinput: Logitech USB Receiver: Failed to create a device for /dev/input/by-id/usb-Logitech_USB_Receiver-if02-event-mouse
(EE) PreInit returned 2 for "Logitech USB Receiver"
(II) UnloadModule: "libinput"

I do have an M570 trackball as well that the receiver is obviously connecting to although it is already linked via a universal receiver.

1

Partial answer: How to get more information

1) Update question with out of lsusb so we can see the vendor and device id.

2) Update question with dmesg output when the combo is recognized. Unplug and replug the dongle to force re-recognition if you can't find it in the boot messages.

3) Run evtest as root on the mouse input device to see (a) what events it claims to produce (b) what actual events it produces when you press the additional keys. Update question with that output.

4) Look into /var/log/Xorg.0.log to see as what device the evdev driver it recognizes. Update question with relevant lines.

That should allow at least to pinpoint the reason why the device gets recognized as mouse.

Edit

I don't understand how the Logitech driver is supposed to work, but what happens is that the second device seems indeed to be reserved for extra keys and for the mouse (EV_REL) events, so maybe it's some kind of catchall thing.

From the kernel side that makes no difference, all the kernel knows is that it translates USB HID events to input events. And udev does symlinks with misleading names, but that doesn't matter, either. What matters is that X seems to decide that the second input device is duplicate (maybe because it has the same name). So I'd try to make an xorg.conf with an InputClass section in it, and play around with various options in the hope to get X to accept the device. I'm not sure why X rejects it, so I can't give step-by-step instructions. See man xorg.conf about options for InputClass, and google a bit to understand what they do if the description is not sufficient, there's plenty of guides.

Besides checking the X log, also have a look at what devices xinput lists. It's enough to make it show up in this list, even if it shows up as mouse - you can reassign it to the Virtual core keyboard. And it will probably get detected as mouse, because X thinks (probably correctly in most cases) that something with EV_REL events must be as mouse, even if it has additional EV_KEY buttons.

  • 1
    That is really helpful, thanks. I'll dive headfirst into xorg.conf: I'm fairly familiar with it but I had incorrectly assumed that the problem was at a lower level – DrMac Jun 24 '17 at 20:08
0

The identification as a mouse, strangely, turned out not to be the most tricky part in getting this to work. This is all that I need in xorg.con

Section "InputClass"
        Identifier      "Wave keyboard extra keys"
        MatchUSBID      "046d:c517"
        MatchIsPointer  "on"
        Driver          "evdev"
        Option          "SendCoreEvents"        "true"
        Option          "Buttons"               "27"
        Option          "Device" "/dev/input/by-id/usb-Logitech_USB_Receiver-if01-event-mouse"
EndSection

The snag is that a lot of the keys turn out to issue keycodes too high for xorg/evdev to hear (scancode > 255) The solution I have found is evrouter, using this config:

"Logitech USB Receiver" "/dev/input/by-id/usb-Logitech_USB_Receiver-if01-event-mouse" none key/418 "XKey/XF86RotateWindows"
"Logitech USB Receiver" "/dev/input/by-id/usb-Logitech_USB_Receiver-if01-event-mouse" none key/419 "XKey/XF86Game"
"Logitech USB Receiver" "/dev/input/by-id/usb-Logitech_USB_Receiver-if01-event-mouse" none key/421 "Xkey/XF86Launch7"
"Logitech USB Receiver" "/dev/input/by-id/usb-Logitech_USB_Receiver-if01-event-mouse" none key/423 "Xkey/XF86Launch8"
"Logitech USB Receiver" "/dev/input/by-id/usb-Logitech_USB_Receiver-if01-event-mouse" none key/397 "Xkey/XF86Launch9"
"Logitech USB Receiver" "/dev/input/by-id/usb-Logitech_USB_Receiver-if01-event-mouse" none key/430 "Xkey/XF86Messenger"
"Logitech USB Receiver" "/dev/input/by-id/usb-Logitech_USB_Receiver-if01-event-mouse" none key/136 "Xkey/XF86Search"

Obviously the Xkey mappings at the end of each line can be adjusted to taste. One key appears unmappable - this is the top-left big silver key with a gear and a window; this does not generate a meaningful scancode at all so I don't think it will ever work. The only other problem, then, is that the Media Centre and (adjacent) 'music notes' key emit the same scan code, so they will always duplicate each other and appear to be the same key. Other than that, all the Fn keys and the media keys work either as expected, or after a short trip to your desktop's keyboard shortcut config.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.