# Logitech MX518, evdev and hotplugging [RESOLVED]

## spuniun

I know, yet another multi-button mouse question, but I've been through all the MX500 threads and no one has posted about this that I can see.

My thumb buttons are registering as buttons 2 and 3, same as the middle and right mouse buttons. the scroll wheel registers as 4 and 5 properly and if I spin the wheel very fast in either direction they register as 6 and 7. So xev is reporting:

Left Mouse Button = 1

Middle Mouse Button = 2

"Back" Thumb Button = 2

Right Mouse Button = 3

"Fwd" Thumb Button = 3

Wheel, Up = 4

Wheel, Down = 5

Wheel, Up Fast = 6

Wheel, Down Fast = 7

Furthermore, Xorg insists that the mouse is 11 buttons regardless of the conf:

```
Section "InputDevice"

    Identifier  "MX518"

    Driver      "mouse"

    Option "Protocol"    "IMPS/2"

    Option "Device"      "/dev/input/mice"

    Option "Buttons" "7"

    Option "ZaxisMapping" "4 5"

EndSection
```

but xorg log shows:

```
(**) Option "Protocol" "IMPS/2"

(**) MX518: Device: "/dev/input/mice"

(**) MX518: Protocol: "IMPS/2"

(**) Option "CorePointer"

(**) MX518: Core Pointer

(**) Option "Device" "/dev/input/mice"

(==) Mouse1: Emulate3Buttons, Emulate3Timeout: 50

(**) Option "Buttons" "7"

(**) Option "ZAxisMapping" "4 5"

(**) MX518: ZAxisMapping: buttons 4 and 5

(**) MX518: Buttons: 11

(**) MX518: SmartScroll: 1
```

Regardless of what I change in either xorg.conf or xmodmap settings, the thumb buttons always appear as buttons 2 and 3 along with middle and right mouse buttons and scrolling the wheel fast as 6 and 7. I removed all options from the xorg.conf and it automatically maps the Zaxis properly and scrolling works but the thumb buttons are still coming up wrong. The mouse is going through an ATEN Master View CS-1764 KVM but dmesg shows the mouse detected properly:

```
usb 3-2.4: new low speed USB device using ohci_hcd and address 6

usb 3-2.4: configuration #1 chosen from 1 choice

input: Logitech USB-PS/2 Optical Mouse as /class/input/input69

input: USB HID v1.10 Mouse [Logitech USB-PS/2 Optical Mouse] on usb-0000:00:02.1-2.4
```

Now that I pasted that I realize I should probably have tested before posting... will post and edit after I do that.

[EDIT]

While taking the KVM out of the equation did smooth out the mouse movement significantly (that was another problem I hadn't dealt with yet), the thumb buttons still report as 2 and 3, meaning I cannot map them appropriately to back and fwd functionality. Any ideas?

gentoo-sources-2.6.16-r9

xorg-x11-6.9.0-r1

[/EDIT]Last edited by spuniun on Tue Jun 20, 2006 9:44 pm; edited 3 times in total

----------

## whig

I have an 'overclocked'  MX510 and use the "evdev" driver for it. IIRC using a evdev setup was easier than mouse-ImPS/2.

----------

## Headrush

I would suggest moving to evdev driver support also. No messing with xmodmap and such should be needed afterwards.

(I think the IMPS/2 driver is limited to the number of buttons it recognizes.)

----------

## spuniun

So, now that I've attempted to use evdev to solve the button issues, I've discovered that X never resumes the mouse after switching KVM to a different console. Seen a few other threads about the same issue and no resolution. udev does pick up the mouse again as seen through cat /dev/input/mx518, it's just xorg that drops the ball.

xorg.conf

```
Section "InputDevice"

    Identifier  "MX518"

    Driver      "evdev"

    Option "Device"      "/dev/input/mx518"

    Option "Name"    "Logitech USB-PS/2 Optical Mouse"

EndSection
```

dmesg

```
usb 3-1.4: USB disconnect, address 8

usb 3-1.4: new low speed USB device using ohci_hcd and address 9

usb 3-1.4: configuration #1 chosen from 1 choice

input: Logitech USB-PS/2 Optical Mouse as /class/input/input7
```

Xorg.log

```
(**) Option "CorePointer"

(**) MX518: Core Pointer

(**) MX518: Device: "/dev/input/mx518"

(II) MX518: Found x and y relative axes

(II) MX518: Found mouse buttons

(II) MX518: Configuring as mouse

(EE) Read error: No such device

(WW) MX518: Release failed (No such device)

(II) Open ACPI successful (/proc/acpi/event)

(II) NVIDIA(0): Setting mode "1600x1200"

(WW) MX518: Grab failed (No such device)

(WW) MX518: Release failed (No such device)

(II) Open ACPI successful (/proc/acpi/event)

(II) NVIDIA(0): Setting mode "1600x1200"

(WW) MX518: Grab failed (No such device)
```

I did notice that it increments the address and input after each switch, and the device is registered as /dev/input/event2 after initial boot, but event3 after switching KVM console. It also seems like X is attempting to to probe for the device a couple times after it loses it, but then gives up. Kernel has built-in hotplugging (hotplug is dead apparently and coldplug is masked against udev-060). Any way to get this hotplugging working with evdev or is it back to no thumb buttons?

----------

## spuniun

Guess this should be moved to Desktop Environments now?

----------

## spuniun

Well now I feel stupid...

Based on the advice of many others, I was using the IMPS/2 protocol with the standard mouse driver and hence, was not getting the correct events fromt eh thumb buttons. All I had to do was switch the the ExplorerPS/2 protocol and the thumb buttons came to life, no need to mess with evdev and it's hotplugging problems. For anyone else using the Logitech MX518 here's my xorg.conf and xmodmap settings:

```
Section "InputDevice"

    Identifier  "MX518"

    Driver "mouse"

    Option "Protocol"    "ExplorerPS/2"

    Option "Device"      "/dev/input/mice"

    Option "AlwaysCore" "true"

    Option "Buttons" "7"

    Option "ZaxisMapping" "4 5"

EndSection
```

```
xmodmap -e "pointer = 1 2 3 4 5 8 9 6 7 10 11"
```

----------

