I have a device that has this output in /proc/bus/input/devices
:
I: Bus=0003 Vendor=05b8 Product=3280 Version=0111
N: Name="PixArt USB Optical Mouse"
P: Phys=usb-0000:00:1a.0-1.1/input0
S: Sysfs=/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1:1.0/input/input89
U: Uniq=
H: Handlers=mouse3 event5
B: PROP=0
B: EV=17
B: KEY=ff0000 0 0 0 0
B: REL=103
B: MSC=10
Where are these bitfields (KEY, REL etc.) set?
Looking around the linux source, it looks like the specific drivers set the bitfields. However, the module that is installed for this device is hid_generic1, which does almost nothing.
I imagine there's also another driver that's listening to the mouse. Is it mousedev? It's something that's creating a file called /dev/input/mouse3
. It seems mousedev needs the bitfields to be set before it decides that it is the driver to match to the mouse device.
Footnotes
1 - How I know hid_generic is being used
dmesg
output when I plug in the moues:
[272055.191824] usb 1-1.1: new low-speed USB device number 23 using ehci-pci
[272055.288221] usb 1-1.1: New USB device found, idVendor=05b8, idProduct=3280
[272055.288232] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[272055.288238] usb 1-1.1: Product: USB Optical Mouse
[272055.288243] usb 1-1.1: Manufacturer: PixArt
[272055.291101] input: PixArt USB Optical Mouse as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1:1.0/input/input88
[272055.291774] hid-generic 0003:05B8:3280.004A: input,hidraw2: USB HID v1.11 Mouse [PixArt USB Optical Mouse] on usb-0000:00:1a.0-1.1/input0
Note hid-generic
is mentioned. I can further verify this by running sudo rmmod hid_generic
and then unplugging and re-plugging the device in. sudo lsmod | grep hid_generic
shows that it's back.
REL & 3
seems is xyz;KEY[0]& 70000
seems is left,right,center buttons. – eri Dec 28 '22 at 09:15