Lenovo N700 mouse function as kbd too - how to disable only the keyboard, not the mouse

Weiwu Zhang a at colourful.land
Sat Apr 29 13:01:53 UTC 2017


This is the old problem of a bluetooth mouse device generating
keyboard key press event (Window key being pressed, followed by letter
c), as an unnecessary "smart" feature, and I needed to configure the
mouse as a pure mouse.

2017-01-13 11:54 GMT+11:00 Peter Hutterer <peter.hutterer at who-t.net>:
>
> another option would also be to add a custom hwdb entry in the style of
> 60-keyboard.hwdb that matches the device to remove the scancode->keycode
> binding and map the key to nothing. that way you solve it at the kernel

This seems to be the right approach. However, matching a specific
hardware against an entry /etc/udev/hwdb.d/70-keyboard.hwdb is not
straightforward. I tried many times in the previous months and failed,
the rule in the file simply isn't effective, and I blame the hardware
matching line. In the end I bought a new mouse.

I tried to google for a way to get the hardware matching line from
udevadm output but failed. The udevadm output is as the following:

$ sudo udevadm info -a -n /dev/input/mouse4

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device
'/devices/virtual/misc/uhid/0005:17EF:6060.0006/input/input27/mouse4':
    KERNEL=="mouse4"
    SUBSYSTEM=="input"
    DRIVER==""

  looking at parent device
'/devices/virtual/misc/uhid/0005:17EF:6060.0006/input/input27':
    KERNELS=="input27"
    SUBSYSTEMS=="input"
    DRIVERS==""
    ATTRS{name}=="Lenovo Mice N700"
    ATTRS{phys}=="B8:8A:60:56:E4:3C"
    ATTRS{properties}=="0"
    ATTRS{uniq}=="D5:94:54:38:3D:5F"

  looking at parent device '/devices/virtual/misc/uhid/0005:17EF:6060.0006':
    KERNELS=="0005:17EF:6060.0006"
    SUBSYSTEMS=="hid"
    DRIVERS=="hid-generic"
    ATTRS{country}=="00"

  looking at parent device '/devices/virtual/misc/uhid':
    KERNELS=="uhid"
    SUBSYSTEMS=="misc"
    DRIVERS==""


More information about the xorg mailing list