Skip to contentSkip to conversation

udev rules for logitech receiver with mouse and keyboard

DISCUSSION Asfand Yar Qazi 1 participant 1 message Jun 30, 2006

lore
Share & tools
lore
#0 lore raw

Hi,

I wanna setup my logitech receiver properly, i.e. if I also buy a logitech wireless keyboard, I also want it to work.

I did the following:

$ cat /proc/bus/input/devices
I: Bus11 Vendor01 Product01 Version«41
N: Name="AT Translated Set 2 keyboard"
P: Phys=isa0060/serio0/input0
S: Sysfs=/class/input/input0
H: Handlers=kbd event0
B: EV0013
B: KEY@2000000 3802078f840d001 f2ffffdfffefffff fffffffffffffffe
B: MSC
B: LED=7

I: Bus03 Vendor8b Product23 Version23
N: Name="Joytech NEO S V2.0b Joytech NEO S V2.0b "
P: Phys=usb-0000:00:02.0-10/input0
S: Sysfs=/class/input/input3
H: Handlers=kbd event3 js0
B: EV000b
B: KEYÿf0000000f 0 80000000000000 e0b0ffdf01cfffff fffffffffffffffe
B: ABS00000300c3
B: LED

I: Bus03 Vendor8b Product23 Version23
N: Name="Joytech NEO S V2.0b Joytech NEO S V2.0b "
P: Phys=usb-0000:00:02.0-10/input1
S: Sysfs=/class/input/input4
H: Handlers=mouse1 event4
B: EV=7
B: KEYp000 0 0 0 0
B: REL3

I: Bus03 Vendor6d ProductÅ1a VersionA00
N: Name="Logitech USB Receiver"
P: Phys=usb-0000:00:02.0-8/input0
S: Sysfs=/class/input/input9
H: Handlers=mouse0 event1
B: EV=7
B: KEYÿff0000 0 0 0 0
B: REL3

I: Bus03 Vendor6d ProductÅ1a VersionA00
N: Name="Logitech USB Receiver"
P: Phys=usb-0000:00:02.0-8/input1
S: Sysfs=/class/input/input10
H: Handlers=kbd event2
B: EV=f
B: KEYÀ002 40000000000 1 f8000078000 6639fad84157ad 8e000000000000 0
B: REL@
B: ABS0000000

Then the following:

$ sudo udevinfo -a -p `sudo udevinfo -q path -n /dev/input/event1`

udevinfo starts with the device the node belongs to and then walks up the device chain, to print for every device found, all possibly useful attributes in the udev key format.
Only attributes within one device section may be used together in one rule, to match the device for which the node will be created.

looking at device '/class/input/input9/event1':

    KERNEL="event1"
    SUBSYSTEM="input"
    SYSFS{dev}="13:65"

looking at device '/class/input/input9':

    ID="input9"
    BUS="input"
    DRIVER=""
    SYSFS{uniq}=""
    SYSFS{phys}="usb-0000:00:02.0-8/input0"
    SYSFS{name}="Logitech USB Receiver"

looking at device '/devices/pci0000:00/0000:00:02.0/usb2/2-8/2-8:1.0':

    ID="2-8:1.0"
    BUS="usb"
    DRIVER="usbhid"
    SYSFS{modalias}="usb:v046DpC51Ad4100dc00dsc00dp00ic03isc01ip02"
    SYSFS{bInterfaceProtocol}="02"
    SYSFS{bInterfaceSubClass}="01"
    SYSFS{bInterfaceClass}="03"
    SYSFS{bNumEndpoints}="01"
    SYSFS{bAlternateSetting}=" 0"
    SYSFS{bInterfaceNumber}="00"

looking at device '/devices/pci0000:00/0000:00:02.0/usb2/2-8':

    ID="2-8"
    BUS="usb"
    DRIVER="usb"
    SYSFS{configuration}="RR41.00_B0021"
    SYSFS{product}="USB Receiver"
    SYSFS{manufacturer}="Logitech"
    SYSFS{maxchild}="0"
    SYSFS{version}=" 2.00"
    SYSFS{devnum}="6"
    SYSFS{speed}="12"
    SYSFS{bMaxPacketSize0}="8"
    SYSFS{bNumConfigurations}="1"
    SYSFS{bDeviceProtocol}="00"
    SYSFS{bDeviceSubClass}="00"
    SYSFS{bDeviceClass}="00"
    SYSFS{bcdDevice}="4100"
    SYSFS{idProduct}="c51a"
    SYSFS{idVendor}="046d"
    SYSFS{bMaxPower}=" 98mA"
    SYSFS{bmAttributes}="a0"
    SYSFS{bConfigurationValue}="1"
    SYSFS{bNumInterfaces}=" 2"

looking at device '/devices/pci0000:00/0000:00:02.0/usb2':

    ID="usb2"
    BUS="usb"
    DRIVER="usb"
    SYSFS{configuration}=""
    SYSFS{serial}="0000:00:02.0"
    SYSFS{product}="OHCI Host Controller"
    SYSFS{manufacturer}="Linux 2.6.17-gentoo ohci_hcd"
    SYSFS{maxchild}="10"
    SYSFS{version}=" 1.10"
    SYSFS{devnum}="1"
    SYSFS{speed}="12"
    SYSFS{bMaxPacketSize0}="64"
    SYSFS{bNumConfigurations}="1"
    SYSFS{bDeviceProtocol}="00"
    SYSFS{bDeviceSubClass}="00"
    SYSFS{bDeviceClass}="09"
    SYSFS{bcdDevice}="0206"
    SYSFS{idProduct}="0000"
    SYSFS{idVendor}="0000"
    SYSFS{bMaxPower}="  0mA"
    SYSFS{bmAttributes}="e0"
    SYSFS{bConfigurationValue}="1"
    SYSFS{bNumInterfaces}=" 1"

looking at device '/devices/pci0000:00/0000:00:02.0':

    ID="0000:00:02.0"
    BUS="pci"
    DRIVER="ohci_hcd"
    SYSFS{modalias}="pci:v000010DEd0000005Asv00001458sd00005004bc0Csc03i10"
    SYSFS{local_cpus}="1"
    SYSFS{irq}="50"
    SYSFS{class}="0x0c0310"
    SYSFS{subsystem_device}="0x5004"
    SYSFS{subsystem_vendor}="0x1458"
    SYSFS{device}="0x005a"
    SYSFS{vendor}="0x10de"

looking at device '/devices/pci0000:00':

    ID="pci0000:00"
    BUS=""
    DRIVER=""

Then the following:

$ sudo udevinfo -a -p `sudo udevinfo -q path -n /dev/input/event2`

udevinfo starts with the device the node belongs to and then walks up the device chain, to print for every device found, all possibly useful attributes in the udev key format.
Only attributes within one device section may be used together in one rule, to match the device for which the node will be created.

looking at device '/class/input/input10/event2':

    KERNEL="event2"
    SUBSYSTEM="input"
    SYSFS{dev}="13:66"

looking at device '/class/input/input10':

    ID="input10"
    BUS="input"
    DRIVER=""
    SYSFS{uniq}=""
    SYSFS{phys}="usb-0000:00:02.0-8/input1"
    SYSFS{name}="Logitech USB Receiver"

looking at device '/devices/pci0000:00/0000:00:02.0/usb2/2-8/2-8:1.1':

    ID="2-8:1.1"
    BUS="usb"
    DRIVER="usbhid"
    SYSFS{modalias}="usb:v046DpC51Ad4100dc00dsc00dp00ic03isc00ip00"
    SYSFS{bInterfaceProtocol}="00"
    SYSFS{bInterfaceSubClass}="00"
    SYSFS{bInterfaceClass}="03"
    SYSFS{bNumEndpoints}="01"
    SYSFS{bAlternateSetting}=" 0"
    SYSFS{bInterfaceNumber}="01"

looking at device '/devices/pci0000:00/0000:00:02.0/usb2/2-8':

    ID="2-8"
    BUS="usb"
    DRIVER="usb"
    SYSFS{configuration}="RR41.00_B0021"
    SYSFS{product}="USB Receiver"
    SYSFS{manufacturer}="Logitech"
    SYSFS{maxchild}="0"
    SYSFS{version}=" 2.00"
    SYSFS{devnum}="6"
    SYSFS{speed}="12"
    SYSFS{bMaxPacketSize0}="8"
    SYSFS{bNumConfigurations}="1"
    SYSFS{bDeviceProtocol}="00"
    SYSFS{bDeviceSubClass}="00"
    SYSFS{bDeviceClass}="00"
    SYSFS{bcdDevice}="4100"
    SYSFS{idProduct}="c51a"
    SYSFS{idVendor}="046d"
    SYSFS{bMaxPower}=" 98mA"
    SYSFS{bmAttributes}="a0"
    SYSFS{bConfigurationValue}="1"
    SYSFS{bNumInterfaces}=" 2"

looking at device '/devices/pci0000:00/0000:00:02.0/usb2':

    ID="usb2"
    BUS="usb"
    DRIVER="usb"
    SYSFS{configuration}=""
    SYSFS{serial}="0000:00:02.0"
    SYSFS{product}="OHCI Host Controller"
    SYSFS{manufacturer}="Linux 2.6.17-gentoo ohci_hcd"
    SYSFS{maxchild}="10"
    SYSFS{version}=" 1.10"
    SYSFS{devnum}="1"
    SYSFS{speed}="12"
    SYSFS{bMaxPacketSize0}="64"
    SYSFS{bNumConfigurations}="1"
    SYSFS{bDeviceProtocol}="00"
    SYSFS{bDeviceSubClass}="00"
    SYSFS{bDeviceClass}="09"
    SYSFS{bcdDevice}="0206"
    SYSFS{idProduct}="0000"
    SYSFS{idVendor}="0000"
    SYSFS{bMaxPower}="  0mA"
    SYSFS{bmAttributes}="e0"
    SYSFS{bConfigurationValue}="1"
    SYSFS{bNumInterfaces}=" 1"

looking at device '/devices/pci0000:00/0000:00:02.0':

    ID="0000:00:02.0"
    BUS="pci"
    DRIVER="ohci_hcd"
    SYSFS{modalias}="pci:v000010DEd0000005Asv00001458sd00005004bc0Csc03i10"
    SYSFS{local_cpus}="1"
    SYSFS{irq}="50"
    SYSFS{class}="0x0c0310"
    SYSFS{subsystem_device}="0x5004"
    SYSFS{subsystem_vendor}="0x1458"
    SYSFS{device}="0x005a"
    SYSFS{vendor}="0x10de"

looking at device '/devices/pci0000:00':

    ID="pci0000:00"
    BUS=""
    DRIVER=""

Are these udev rules alright to distinguish the event device delivering keyboard events from mouse events?

# Logitech Receiver Mouse
BUS="usb", \
SYSFS{modalias}="usb:v046DpC51Ad4100dc00dsc00dp00ic03isc01ip02", \
SYSFS{bInterfaceNumber}="00", \
KERNEL="event?", \
NAME="input/%k", \
SYMLINK="input/logitech_receiver_mouse"

# Logitech Receiver Keyboard
BUS="usb", \
SYSFS{modalias}="usb:v046DpC51Ad4100dc00dsc00dp00ic03isc01ip02", \
SYSFS{bInterfaceNumber}="01", \
KERNEL="event?", \
NAME="input/%k", \
SYMLINK="input/logitech_receiver_keyboard"

Thanks for your help

And if you're curious, here's approximately what's going in my xorg.conf file:

Section "InputDevice"

        Identifier  "LogitechReceiverMouse"
        Driver      "evdev"
        Option      "Dev Name"      "Logitech USB Wireless Mouse"
        Option      "Device"        "/dev/input/logitech_receiver_mouse"
        Option      "Buttons"       "8"
        Option      "ZAxisMapping"  "4 5 7 8"
        Option      "Emulate3Buttons" "no"

EndSection

p.s. Please CC me, I'm not on the list.

Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel