Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know how to make another button act as the middle button but how can I map several mouse buttons to the middle button?

xmodmap complains if I repeat button numbers in the pointer option.

share|improve this question

I think you can configure the Option "ButtonMapping" in your mouse's Section "InputDevice" of xorg.conf. There you should set the physical button(s) to logical button 2.


Section "InputDevice"
  Identifier     "Mouse0"
  Driver         "mouse"
  Option         "Protocol" "auto"
  Option         "Device" "/dev/psaux"
  Option         "Emulate3Buttons" "no"
  Option         "ZAxisMapping" "4 5"
  Option         "ButtonMapping" "1 2 3 4 5 2"
share|improve this answer

To make the left and right buttons act as the middle button when pressed together, you need to activate 3-button emulation. In older Xorg releases, set Option "Emulate3Buttons" "yes" in the appropriate InputDevice section of xorg.conf.

In Xorg 1.4 through 1.7, add a HAL configuration fdi file such as:

<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
         Default input configuration is defined in:
         Settings here modify or override the default configuration.
         See comment in the file above for more information.

         To see the currently active hal input configuration
         run lshal or hal-device(1m) and search for "input.x11*" keys.

         Hal and X must be restarted for changes here to take any effect
    <match key="info.capabilities" contains="input.mouse">
      <merge key="input.x11_options.Emulate3Buttons" type="string">on</merge>

In Xorg 1.8 and later, add a file in the xorg.conf.d directory such as:

Section "InputClass"
    Identifier "middle button emulation class"
    MatchIsPointer "on"
    Option "Emulate3Buttons" "on"
share|improve this answer
My mouse has 18 buttons ... at least X says so. I could find only 7. – Aaron Digulla Mar 18 '11 at 10:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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