# This is how I got my MX510 (MX500, MX700) to work (with gdm)

## torklingberg

This one is for the forum searchers. I myself had problems finding any good info.

So, this is how I got the back button, forward button and scroll wheel to work on my Logitech MX510 Optical USB mouse, using Gnome and gdm. It should work for MX500 and MX700 too, since they have the same buttons. The small buttons around the scroll wheel does not work properly for me, so please tell me how if you know.

emerge imwheel

In /etc/X11/xorg.conf (or XF86Config or whatever X conf file you have), I have this:

```

    Identifier  "Mouse1"

    Driver  "mouse"

    Option  "Protocol" "ExplorerPS/2"

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

    Option  "ZAxisMapping" "6 7"

    Option  "buttons" "7"

    Option  "Resolution" "400"

```

Now create the folder /etc/X11/xinit/xinitrc.d and in there create the file mouse with:

```

xmodmap -e "pointer = 1 2 3 6 7 4 5" &

imwheel -k -p -b "67" -f &

```

Now make the file executable

```
chmod +x mouse
```

And now create an ~/.imwheelrc like this

```

"(null)"

None,           Up,     Alt_L|Left              # Go back

None,           Down,   Alt_L|Right             # Go forward

Control_L,      Up,     Control_L|Page_Up       # Previous tab

Control_L,      Down,   Control_L|Page_Down     # Next tab

 

"^Firebird.*"

None,           Up,     Alt_L|Left              # Go back

None,           Down,   Alt_L|Right             # Go forward

Shift_L,        Up,     Control_L|Page_Up       # Previous tab

Shift_L,        Down,   Control_L|Page_Down     # Next tab

 

"^Firefox.*"

None,           Up,     Alt_L|Left              # Go back

None,           Down,   Alt_L|Right             # Go forward

Shift_L,        Up,     Control_L|Page_Up       # Previous tab

Shift_L,        Down,   Control_L|Page_Down     # Next tab

 

"^Mozilla.*"

None,           Up,     Alt_L|Left              # Go back

None,           Down,   Alt_L|Right             # Go forward

Shift_L,        Up,     Control_L|Page_Up       # Previous tab

Shift_L,        Down,   Control_L|Page_Down     # Next tab

 

"^Epiphany.*"

None,           Up,     Alt_L|Left              # Go back

None,           Down,   Alt_L|Right             # Go forward

Shift_L,        Up,     Control_L|Page_Up       # Previous tab

Shift_L,        Down,   Control_L|Page_Down     # Next tab

 

"^Dillo*"

None,           Up,     comma

None,           Down,   period

 

#last lines

".*"

None,           Up,     Alt_L|Left              # Go back

None,           Down,   Alt_L|Right             # Go forward

Control_L,      Up,     Control_L|Page_Up       # Previous tab

Control_L,      Down,   Control_L|Page_Down     # Next tab

```

Now, that should be enough. I'm sure there are some menaingles stuff in there, but it works for me. If it does not work, then try running the xmodmap and imwheel lines in a console. It that works, then you just need to find a place to put thiose lines so they are executed automatically.

Emacs, of course, doesn't want to work like other programs so you have to make the scrollwheel work manually. With xemacs, I put (mwheel-install) in ~/.xemacs/init.el 

Other good links:

https://forums.gentoo.org/viewtopic.php?t=178733 (general info)

http://www.glaurung.demon.co.uk/info/linux.mx500.howto.html (general info)

https://forums.gentoo.org/viewtopic.php?t=69991 (emacs)

----------

## JudgeNik

The small button infront of the scroll wheel has some bug either in the kernel or the drivers being used. Use "xev" to see what button is acting as what.

By the way do you have the red mx510   :Cool:   I've got the MX700 at the moment but am considering selling it and going to the awesome looking red MX510 instead.

----------

## floffe

 *JudgeNik wrote:*   

> The small button infront of the scroll wheel has some bug either in the kernel or the drivers being used. Use "xev" to see what button is acting as what.

 

The mousedev drivers don't support as many as 10 buttons, which these mice have. And unfortunately the evdev driver which supports 10 buttons doesn't work with xorg   :Confused: 

To use all 10 buttons with xfree, see the howto "10-button mice" in the Docs, tips and tricks forum.

----------

## nielchiano

ok, to get my imwheel to work, I need to start it as the logged in user...

I use KDE; where is THE place to put the command? (what script gets executed after login, under the user's account?)

----------

## Thardin

Thank you *very* much. Will it also work with KDE?

Edit: Doh... of course it will... it's all based on X...

----------

## ribx

also a BIG thanks from me! i had exactly the same problem like you.. many threads, many words but no content at all.

good work! respect  :Smile: 

----------

## AliceDiee

 *floffe wrote:*   

> The mousedev drivers don't support as many as 10 buttons, which these mice have. And unfortunately the evdev driver which supports 10 buttons doesn't work with xorg  
> 
> 

 

Section "InputDevice"

        Identifier  "Mouse0"

        Driver      "mouse"

        Option      "Protocol" "evdev"

        Option      "Buttons" "10"

        Option      "ZAxisMapping" "9 10"

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

        Option      "Dev Phys" "usb-*/input0"

EndSection

xorg is running perfectly here   :Exclamation: 

I should mention that I'm using this patchset which includes the kernel-events-rml patch and the configurable-hid-mouse-polling patch for smoother movement.

----------

## khendon

Have done exactly as is suggested in this thread but I have no mouse wheel or buttons. MX510 mouse connected to a nForce3 board. Is there some kernel stuff that needs to be done and that everyone does without thinking except me?

Edit: Connected to an USB port. Tried connecting it to the PS/2 port with the same settings, but naturally got no mouse at all.

----------

## bassM

Interesting problem here: I got both scroll and back and forward working, only they are not associated with the correct buttons. 

The scrollwheel and the scroll-buttons do the back and forward and the back and forward buttons do the scrolling. 

I have everything setup exactly like torklingberg...

EDIT: Solved!

----------

## Valheru

 *bassM wrote:*   

> Interesting problem here: I got both scroll and back and forward working, only they are not associated with the correct buttons. 
> 
> The scrollwheel and the scroll-buttons do the back and forward and the back and forward buttons do the scrolling. 
> 
> I have everything setup exactly like torklingberg...
> ...

 

If you solve something, it's customary to include your solution, so that people who use the search function don't ahve to ask how you did it :p

Now, how did you do it?

----------

## Sci-Fi

I am also interested how did you solve your problem.

I have the same problem myself

----------

## Grubshka

 *Sci-Fi wrote:*   

> I am also interested how did you solve your problem.
> 
> I have the same problem myself

 

Try to use xmodmap differently ?

(consequently, you may have to change the     Option  "ZAxisMapping" "6 7"   in xorg.conf)

----------

## Stormmind

I got mine mx510 working perfectly without any patches or even imwheel with this config:

```

'# Logitech MX510

Section "InputDevice"

        Driver      "mouse"

        Identifier  "Mouse0"

        Option      "Protocol" "ExplorerPS/2"

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

        Option      "Buttons" "7"

        Option      "ZAxisMapping" "6 7"

        Option      "Name" "Logitech MX 510"

EndSection

```

The scroll wheel is working in all apps I tryed (like aterm, mosilla, etc..) and the buttons on the side work too (history(-1) and history(+1) in mozilla). The small buttons near the scrollwheel work as up arrow and down-arrow - scroll. The last button doesn't seem to do anything noticable. 

No I haven't done anything special, just wrote the above in config and plugged it in the usb-port (didn't work on ps/2).

----------

