I had the mouse buttons inverted on Gnome, and I wanted to do the same on xmonad but I don't know how to do it. Does anyone knows what is the adequate configuration?

link|improve this question
I asked this in the irc and was told it was X server configuration.Am still to figure it out though. – Anand Jeyahar Jul 21 '11 at 13:52
feedback

migrated from stackoverflow.com Jul 12 '11 at 1:05

This question came from our site for professional and enthusiast programmers.

2 Answers

You can change mouse settings in xorg.conf (if you have one) or by using xmodmap. For 3-button mouse xmodmap command should look like:

xmodmap -e "pointer = 3 2 1"
(first button acts like third, second as second and third like first)

If you have more buttons you may list actual config using:

xmodmap -pp
link|improve this answer
feedback

You can configure that globally for X. Edit /etc/X11/xorg.conf, find the InputDevice section for your mouse, that should begin with something like

Section "InputDevice"
        Identifier  "Mouse2"
        Driver      "mouse"
        Option      "Device" "/dev/input/mouse1"

(...)

and add

       Option   "ButtonMapping" "3 2 1 4 5"

somewhere within that section. The numbers in the second quote correspond to the buttons you have, so if you have only 3 button mouse, you'd only need to put

       Option   "ButtonMapping" "3 2 1"

an so on.

After that, of course, restart your X.

EDIT: Another way would be to add something like xmodmap -e "pointer = 3 2 1" to your ~/.xinitrc file (if you use startx) or at the end of /etc/X11/Sessions/Xsession or /etc/X11/gdm/Xsession.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.