# MX510 Howto?

## piercey

Hi everyone,

I recently got a new Logitech MX510 mouse and I must say it's great  :Smile:  However so far I've been unable to get all the buttons working right. I put the following in my xorg config:

```

Section "InputDevice"

        Identifier "Mouse1"

        Driver "mouse"

        Option      "Protocol"              "ExplorerPS/2"

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

        Option    "ZAxisMapping"    "4 5"

EndSection

```

This makes my mouse work. However the extra buttons on the side dont work, and the 3 other small buttons on the mouse are mapped to the same buttons as middle scroll up, middle scroll down and left click (Ive tested this with xev). I'm wondering does anyone know anyway I could get to use all the buttons on the mouse for shortcuts?

Any help is appreciated!

----------

## 1U

I have the same mouse  :Smile: 

This is what I use in my xorg and it seems to work very well:

```
    Identifier  "Mouse1"

    Driver      "mouse"

    Option      "ButtonNumber" "7"

    Option      "Buttons" "7"

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

    Option      "InputFashion" "Mouse"

    Option      "Name" "USB-Mouse;ExplorerPS/2"

    Option      "Protocol" "ExplorerPS/2"

    Option      "ZAxisMapping" "6 7"
```

After you edit that, be sure to emerge imwheel and have this run when you start your graphical session (such as openbox and etc)

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

I hope the above works, but if it doesn't just play around with those numbers and look at other people's configuratio files on this forum. It didn't take me long to figure out the best setting. I still don't have my top scrolling button working, but I don't use those tiny buttons anyways.

Also, our mouses support faster than usual polling. This is very handy if you play fast games, check out this thread for more info:

https://forums.gentoo.org/viewtopic-t-164679-highlight-logitech+patch+kernel.html

Hope that helps.

----------

## bammbamm808

 *1U wrote:*   

> I have the same mouse :)
> 
> This is what I use in my xorg and it seems to work very well:
> 
> ```
> ...

 

You can do the same without imwheel. I don't have it installed. Just run xmodmap as described and your scrollwheel will work fine.

And the polling kernel patch is nice. I think I play UrT better with it, which isn't saying much.

----------

## 1U

 *bammbamm808 wrote:*   

> You can do the same without imwheel. I don't have it installed. Just run xmodmap as described and your scrollwheel will work fine.
> 
> And the polling kernel patch is nice. I think I play UrT better with it, which isn't saying much.

 

Don't mean to go offtopic, but just curious, how are the pings over there in Hawaii when playing fps games in American/Europe?

I use nitro-sources and it has that patch built in already. It helps me too.

----------

## piercey

Hey guys thanks for the replies. I have been searching around and have tried this method before to get my buttons working. AFter following what you described I have been able to get all my buttons working. However not in the right order. Hence why Im meant to use xmodmap, however it gives me this error which is really confusing:

```

pierce@zim ~ $ xmodmap -e "pointer = 1 2 3 6 7 4 5"

xmodmap:  commandline:0:  bad number of buttons, must have 12 instead of 7

xmodmap:  1 error encountered, aborting.

```

Why does it think I have 12 buttons? Thanks for the help!

----------

## infiniteedge

whateverLast edited by infiniteedge on Sat Sep 17, 2005 7:11 pm; edited 1 time in total

----------

## irondog

Go home and ask your mother to solve your problems.

----------

## irondog

Infiniteedge, in fact mouse button support sucks in 6.8.2, But complaining in this forum won't help.

Never mind, you got my point.

----------

## 1U

Yeah my buttons aren't perfect either, but not bad enough to complain. The little tiny scrolling buttons by the scroll wheel don't work, but I don't really care.

----------

## th0th696

okay count em:

1 leftclick

2 rightclick

3 middleclick

4mousewheel up

5mousewheel down

6 sidebutton1

7 sidebutton2

8 topbuttonforward

9 topbuttonbackward

10 appswitchbutton

So why are you guys using 7?

here's my xorg after trolling around this forum:

Section "InputDevice"

        Identifier  "Logitech MX 510"

        Driver      "mouse"

        Option      "Protocol" "ExplorerPS/2"

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

        Option      "ButtonNumber" "10" 

        Option      "InputFashion" "Mouse" 

        Option      "Buttons" "10" 

        Option      "ZAxisMapping" "6 7" 

        Option      "resolution" "800" 

EndSection

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

And everything works except those pesky top buttons!  Has anyone gotten them to work?

----------

## Headrush

Hmmm, could be a change to the ExplorerPS/2 driver.

If I remember correctly, the ExplorerPS/2 driver at one time only supported up to 5 or 7 buttons and that to use all the buttons you had to use the event driver.

If this has changed, that would be nice, but for anyone else, using the event driver should let you get control of all your mouse buttons.

----------

## /carlito

 *th0th696 wrote:*   

> And everything works except those pesky top buttons!  Has anyone gotten them to work?

 

You should not configure the top buttons as they are only an extension of your scroll wheel, when not configured in corg.conf they should work.

My config (I don't use the app switch button as it annoys me  :Smile:  )

/etc/X11/xorg.conf

```
Section "InputDevice"

    Identifier  "MX700"

    Driver      "mouse"

    Option      "Protocol"     "ExplorerPS/2"

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

    Option      "Buttons"      "7"

    Option      "ZAxisMapping" "6 7"

    Option      "Emulate3Buttons"       "no"

EndSection

```

~/.Xmodmap

```
pointer = 1 2 3 6 7 4 5

```

/etc/X11/xinit/xinitrc.d/MX700

```
setpointer MX700

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

killall -9 imwheel

/usr/bin/imwheel -k -b "45" &

```

----------

## Headrush

/carlito, the buttons around the scroll wheel work perfectly with the evdev driver. 

If when you press one of the buttons, you get two events, 1 the same as the scroll wheel and another one, you need to use the logitech_applet to disable cruise control.

```
/usr/sbin/logitech_applet --disable-cc
```

P.S. with the evdev driver in xorg-6.9.XX or xorg-7.X everything works without any changes. (.xprofile, logitech_applet, etc)

----------

## pholthau

on kde there is a logitech_mouse use flag. this enables control over the mouse in kde control center. but i dont know why the settings are not saved. everytime i reboot, my mx510 is back at 400 dpi

----------

## Headrush

 *pholthau wrote:*   

> on kde there is a logitech_mouse use flag. this enables control over the mouse in kde control center. but i dont know why the settings are not saved. everytime i reboot, my mx510 is back at 400 dpi

 

Is the group settings for the mouse device node=kdemouse? (Or applicable permissions to accomplish same thing)

----------

## pholthau

i dont have a group called kdemouse, so the devices belong to group root...

----------

## Headrush

 *pholthau wrote:*   

> i dont have a group called kdemouse, so the devices belong to group root...

 

You have to make the kdemouse group and use a custom udev rule to make kdemouse the group for the mouse device nodes.

pholthau, I wouldn't bother with this as there isn't much you can configure there anyways.

If you still want to, post the output of lsusb and I'll give you a udev rule. (I can't post my because it is specific to a MX700)

----------

## pholthau

here it is:

```

illidan pholthau # lsusb

Bus 004 Device 001: ID 0000:0000

Bus 003 Device 002: ID 046d:c01d Logitech, Inc.

Bus 003 Device 001: ID 0000:0000

Bus 002 Device 002: ID 413c:8000 Dell Computer Corp.

Bus 002 Device 001: ID 0000:0000

Bus 001 Device 004: ID 05e3:0702 Genesys Logic, Inc. USB 2.0 IDE Adapter

Bus 001 Device 001: ID 0000:0000

```

----------

## Headrush

pholthau, add the following line to /etc/udev/rules.d/10-local.rules and then restart udev, by typing udevstart as root.

```
BUS="usb", SYSFS{idVendor}="046d", SYSFS{idProduct}="c01d",NAME="input/%k", SYMLINK="input/MX510", GROUP="kdemouse", MODE="0664"
```

Of course you have to create the kdemouse group also and have the user in that group first.

```
groupadd kdemouse

gpasswd -a username kdemouse
```

Change username to your user login name.

----------

## pholthau

thanks, ill give it a try!

----------

## Headrush

 *pholthau wrote:*   

> thanks, ill give it a try!

 

How did you make out?

I have both a MX700 and MX510 connected now and all buttons work on both.

----------

## pholthau

hm... my buttons work because of this:

```

pholthau@illidan ~ $ cat .Xmodmap

keycode 160 = XF86AudioMute

keycode 174 = XF86AudioLowerVolume

keycode 176 = XF86AudioRaiseVolume

keycode 162 = XF86AudioPlay

keycode 144 = XF86AudioPrev

keycode 153 = XF86AudioNext

keycode 164 = XF86AudioStop

pointer = 1 2 3 6 7 8 9 10 4 5

pholthau@illidan ~ $ cat .xprofile

xmodmap $HOME/.Xmodmap

```

but the resolution still stays at 400...

do i have to change xorg.conf to use /dev/input/MX510 ??

the udev rule seems to work:

```

illidan pholthau # ls -l /dev/input/

total 0

lrwxrwxrwx 1 root root            9 Feb 10 15:50 MX510 -> usbdev3.2

crw------- 1 root root      13,  64 Feb 10 14:21 event0

crw------- 1 root root      13,  65 Feb 10 14:21 event1

crw------- 1 root root      13,  66 Feb 10 14:21 event2

crw-rw-r-- 1 root kdemouse  13,  67 Feb 10 14:21 event3

crw-r--r-- 1 root root      13,  63 Feb 10 14:21 mice

crw-r--r-- 1 root root      13,  32 Feb 10 14:21 mouse0

crw-r--r-- 1 root root      13,  33 Feb 10 14:21 mouse1

crw-rw-r-- 1 root kdemouse  13,  34 Feb 10 14:21 mouse2

crw-rw-r-- 1 root kdemouse 189, 257 Feb 10 14:21 usbdev3.2

```

----------

## Headrush

 *pholthau wrote:*   

> hm... my buttons work because of this:
> 
> ```
> 
> pholthau@illidan ~ $ cat .Xmodmap
> ...

 

That doesn't cause the buttons to work, it just assigns keycodes to the buttons and changes the button order.

 *pholthau wrote:*   

> but the resolution still stays at 400...
> 
> do i have to change xorg.conf to use /dev/input/MX510 ??
> 
> the udev rule seems to work:

 

You shouldn't have to change anything in xorg.conf.

It does not work in kcontrol?

kcontrol was emerged with the logitech-mouse USE flag?

Is logitech-applet emerged?

The user is in the kdemoouse group?

Are the logitech options in kcontrol greyed out, or accessible but don't change anything?

Does this work from the command line as root:

```
logitech_applet -s 800
```

----------

## pholthau

hm i think you misunderstood my problem.  :Smile:  the kcontrol options are there and they work (as well as logitech_applet). the only thing is, that i have to adjust the mouse resolution everytime at startup or mouse plug in.

----------

## Headrush

 *pholthau wrote:*   

> hm i think you misunderstood my problem.  the kcontrol options are there and they work (as well as logitech_applet). the only thing is, that i have to adjust the mouse resolution everytime at startup or mouse plug in.

 

I understood, but it is always good to clarify things. It not only helps make sure we are talking about the same thing but will help others who read this or may have issues with this in the future.

Saving the options works fine here and is restored correctly. Sounds like maybe a corrupt preference file in ~/.kde

Either try backing up ~/.kde and see if the problem persists when a clean ~/.kde is created when you re-login, or create a new user and login in with that user. If either works, we know it is a preference file and we just need to find the correct file.  :Smile: 

----------

## pholthau

ok ill try it. but on sunday, cause i don't have my mouse with me atm...  :Wink: 

----------

## azp

 *Headrush wrote:*   

>  *pholthau wrote:*   thanks, ill give it a try! 
> 
> How did you make out?
> 
> I have both a MX700 and MX510 connected now and all buttons work on both.

 

I own a MX510, and have been searching for a good solution to my problems for three months now. I can't get all the buttons on my MX510 to work with evdev + Xorg7.0. As it is now, the scroll is working (with scrolling and pushing) but all the other buttons behave as mouse button 1 (left button).

```
:Section "InputDevice"

     Identifier   "MX510"

     Driver       "evdev"

     Option       "Device" "/dev/input/event-mx510"

EndSection
```

```
KERNEL="event*", SYSFS{idVendor}="046d", SYSFS{idProduct}="c01d", NAME="input/event-mx510", MODE="664", SYMLINK="input/%k"

KERNEL="mouse*", SYSFS{idVendor}="046d", SYSFS{idProduct}="c01d", NAME="input/mouse-mx510", MODE="664", SYMLINK="input/%k"
```

```
logitech_applet --set-res=800
```

```
options usbhid mousepoll=1
```

And I don't use Xmodmap or imwheelrc or anything like that.

xev and evtest shows the buttons mapped as

1 left

2 scrollclick

3 right

4 scroll up

5 scroll down

9 upper thumb

8 lower thumb

10 application button

11 scroll upp button

12 scroll down button

This means that I have no 6 and 7, and that might be causing a problem. Any tips or tricks?

----------

## Headrush

azp, you seem to have all the buttons working. Don't worry about buttons 6 and 7 as they are used for horizontal scrolling which that mouse doesn't.

Are you sure the left button isn't 3 and the scroll wheel button is 2?

----------

## azp

yes I was wrong..

Scrollclick is 2 and rightclick is 3. Leftclick is of course 1.

But how do I do to actually get the buttons to respond? The "back" and "forward" button by the thumb doesn't work at all =(

They just act like button 1. Actually all buttons do, except the "five" normal ones (3+scroll).

EDIT: In Enemy Territory, all "other" buttons respond to KP_EQUAL which sounds just strange..

EDIT2: It does work in Americas Army! The number of the buttons have change since before I installed xorg7, but at least they get a number. wohoo..

----------

## Headrush

 *azp wrote:*   

> yes I was wrong..
> 
> Scrollclick is 2 and rightclick is 3. Leftclick is of course 1.

 

I knew it!  :Smile: 

 *azp wrote:*   

> But how do I do to actually get the buttons to respond? The "back" and "forward" button by the thumb doesn't work at all =(
> 
> They just act like button 1. Actually all buttons do, except the "five" normal ones (3+scroll).

 

Until they are mapped otherwise, that is normal.

 *azp wrote:*   

> EDIT: In Enemy Territory, all "other" buttons respond to KP_EQUAL which sounds just strange..

 

This might be a ET problem if it works in other games.

 *azp wrote:*   

> EDIT2: It does work in Americas Army! The number of the buttons have change since before I installed xorg7, but at least they get a number. wohoo..

 

The order can appear to change when making changes to /etc/xorg.conf or upgrading to xorg 7. 

There are several methods of mapping the buttons to actions. A lot depends on the desktop environment you are using and there are several threads about doing this. The important thing is that all the buttons are separately recognized in xev. Your xorg config is correct and need not be changed.

----------

## Citizen Bleys

New here, and not sure if thread bumping is frowned upon, so sorry if I was supposed to make a new thread.

I've got a new install of Gentoo.  This is the first time I've ever used it outside of brief experimentation, so I'm not too familiar with it yet.

Alright...so I get Gentoo installed, and mostly everything seems to be working...except my mouse wheel.  I read this thread over, and tried to follow the instructions.

Problem:  No /etc/X11/xorg.conf file.  There is, however, an xorg.conf.example.  Will I ruin anything if I just cp xorg.conf.example xorg.conf and edit that file?  And once I do have an xorg.conf, how do I force the changes to take effect?  This is Linux, I'm not supposed to have to reboot.

(Yes, my fledgling install does have some serious problems with it--no sound for starters, and all those error messages at boot, but none of them are driving me UP THE FRICKING WALL like my scroll wheel not working is.)

----------

## Headrush

 *Citizen Bleys wrote:*   

> Problem:  No /etc/X11/xorg.conf file.  There is, however, an xorg.conf.example.  Will I ruin anything if I just cp xorg.conf.example xorg.conf and edit that file?

 

No. you can do that and there is also two programs; xorgcfg and xorgconfig which you can use to start generating a xorg.conf file more geared to your system.

 *Citizen Bleys wrote:*   

> And once I do have an xorg.conf, how do I force the changes to take effect?  This is Linux, I'm not supposed to have to reboot.

 

Each time the X server is started the config file is reread, so if X isn't running, justing starting it is sufficient. If X is running, CTRL-ALT-Backspace will force the X server to restart.

----------

## azp

 *Citizen Bleys wrote:*   

> Problem:  No /etc/X11/xorg.conf file.  There is, however, an xorg.conf.example.  Will I ruin anything if I just cp xorg.conf.example xorg.conf and edit that file?

 

Your install must have been done without following the gentoo manual. I guess you're accustomed to Linux, since you installed it without any problems (except the ones you're experiencing now), but I - without undermining your intelligence or knowledge in any way - really advice you to go through the install manual. You can selectively read the parts you need. I believe there is a chapter about the whole xorg install.

There is also a part about sound and ALSA + a whole ALSA-guide not connected to the install. One thing about gentoo is the awesome documentation!

Good luck, and break a leg! (Not your box!)

----------

