Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I have a basic logitech mouse with 5 buttons: left, right, wheel left, wheel, wheel right.

I used to use wheel left and right for going back and forward in my browser or navigator. Now this doesn't work. I've found many solutions, people telling to install this program or that, didn't seem to work.

share|improve this question
Can you give us a little more detail about what you tried and how that failed? –  guntbert Feb 4 '13 at 19:20
I just tried three different programs to map keys and/or keyboard shortcuts (one was an ccsm plugin, another one was just a tool I downloaded at the software center and so was the last one). But honestly I forgot their names, and I now upgradede to 12.10 so I doubt if I can find them back =) –  Brent Roose Feb 5 '13 at 8:24
Please provide additional information by editing your question. Comments might/will get lost some time. –  guntbert Feb 5 '13 at 17:24

2 Answers 2

  1. Install the package xautomation, we need the command xte

    sudo apt-get install xautomation
  2. Install the package x11-utils, we need the command xev

    sudo apt-get install x11-utils
  3. Check the code for the two mouse buttons.

    • Start the command xev in a terminal:

    • Move the mouse in the new window

    • Press your wheel left and wheel right

    In my case, note the output button 6 and button 7:

    ButtonRelease event, serial 36, synthetic NO, window 0x2e00001,
        root 0x233, subw 0x0, time 9222464, (94,21), root:(1774,85),
        state 0x10, button 6, same_screen YES
    ButtonPress event, serial 36, synthetic NO, window 0x2e00001,
        root 0x233, subw 0x0, time 9223854, (94,21), root:(1774,85),
        state 0x10, button 7, same_screen YES
  4. Edit your xbindkeys configuration, e.g.:

    nano ~/.xbindkeysrc

    and add the lines below

    "xte 'keydown Alt_L' 'keydown Left' 'keyup Left' 'keyup Alt_L'"
    "xte 'keydown Alt_L' 'keydown Right' 'keyup Right' 'keyup Alt_L'"

    Replace b:6 and b:7 with your numbers of xev output

    • from man xte

      key k
            Press and release key k
      keydown  k
            Press key k down
      keyup k
            Release key k
  5. Kill all kbindkeys processes

    killall xbindkeys
  6. Restart xbindkeys with your configuration, eg:

    xbindkeys -f ~/.xbindkeysrc
share|improve this answer

There are multi mouse button instructions here and xorg.conf info here.

Essentially, you mess around with xinput. (Or imwheel for more options.)

First, open a Terminal. List your input devices:

# show all input devices
xinput list

You'll get something like this:

$ xinput list
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Microsoft Natural® Ergonomic Keyboard 4000        id=11   [slave  pointer  (2)]
⎜   ↳ Evoluent VerticalMouse 4                  id=12   [slave  pointer  (2)]

I have an Evoluent VerticalMouse. You can see the identifier number is 12: "id=12".

I can test my mouse with:

# show all input from device with identifier number 12
xinput test 12

Now when I move my mouse or click, I get output in that terminal telling me what button I pressed. Hit Ctrl-c to end the test.

If your back/forward buttons aren't giving you output, try resetting your button map to the default with set-button-map. Note that I'm using my device name that was output by xinput list:

xinput set-button-map "Evoluent VerticalMouse 4" 1 2 3 4 5 6 7 8 9 10 11 12 13 14

Now try running xinput test with your id. If you're getting correct button responses here, then you just need to figure out the mapping you want and update your xorg.conf. (I don't know how to do that yet.)

share|improve this answer

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.