Lenovo N700 mouse function as kbd too - how to disable only the keyboard, not the mouse
Peter Hutterer
peter.hutterer at who-t.net
Tue May 2 03:17:07 UTC 2017
On Sat, Apr 29, 2017 at 11:01:53PM +1000, Weiwu Zhang wrote:
> 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"
you have three items to match here, the bus:vendor:product match
(5/17EF/6060) which would match any of these devices, or the bluetooth MAC
address which should be unique. Or just the name of the mouse would likely
do too for your usecase.
the hwdb line isn't anything fixed, it depends on whatever calls the hwdb
builtin. Usually it's called by a udev rule, and thus the hwdb matching
format depends on the udev rule. Have a look at e.g. 60-evdev.hwdb and the
corresponding 60-evdev.rules.
Cheers,
Peter
>
> 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