Jump to content
Sign in to follow this  

5 button mouse

Recommended Posts

Fist i would like to say HI to every one


I have a Trackball Explorer is they a way to get all of the buttons to work in Manderake 10 official




Share this post

Link to post
Share on other sites

Yes, but I don't know how.



Seriously though, this has come up before, and it is certainly possible to map those buttons to usefull functions, but I seriously have not ever figured out how. Of course, I don't have a 5 button mouse, so why would I bother to figure it out???


Just search the hardware forum for 'mouse' it'll be in there somewhere.

Share this post

Link to post
Share on other sites


This should help you. ramfree17 had already quoted it from old forums (see here), but being in a quote prevents it from being found by the search feature...


3 buttons + wheel (button). i want to use the 3rd button and not the wheel as the 3rd button.
The solution is in two steps:


- step 1: configure properly your mouse, so that all your buttons are recognized, whatever the numbers assigned to them.

- step 2: use the xmodmap command to reassign the buttons numbers.


I think I can help you for both steps, but I have a Logitech optical USB MouseMan+ (code M-BD53) with wheel and thumb button (the one which is for right-handed persons only), and I don't know how much of my experience will apply to your mouse. I'll try to explain all along, so that you're able to adapt. Here's how I would do that:


step 1


Login as root (or better: su - root, if you know what I mean). In /etc/X11/. In my case, here is the total section:

Section "InputDevice"

 Identifier "Mouse1"

 Driver "mouse"

 Option "Protocol" "ExplorerPS/2"

 Option "Device" "/dev/psaux"

 Option "Buttons" "8"

 Option "ZAxisMapping" "6 7"

 Option "Resolution" "400"


I'll now comment it. Identifier and Driver can (must?) be left unchanged. Protocol and Device are totally unrelated: you can perfectly use the "PS/2" protocol (a good start) with an USB device.


Normally, Device should be left unchanged if your mouse works (else is wouldn't work...). But if that's not the case (you're in "keyboard-only usage"), try putting the good device (usually /dev/usbmouse for USB or /dev/psaux for PS/2).

Here I use the "ExplorerPS/2" protocol, which enables me to use all buttons (the "MouseManPlusPS/2" protocol does not allow the usage of the thumb button for me).


First remove the ZAxisMapping line (you'll put it back later). Restart X. Open xev (thumb).


You can now put the Option "ZAxisMapping" line again. After "ZAxisMapping", put "UB DB", that is "6 7" in my case.


You're done with this file: all your buttons should have a number, hence be recognized.


step 2


Now you should know that all applications expect LB, MB, RB, UB, and DB to be 1, 2, 3, 4, and 5 in that order. But it is not the case for all protocols (eg. my mouse's protocol). So you have to tell X to adjust to your protocol. The way to do that is to execute a command similar to the following:

xmodmap -display :0 -e "pointer = 1 2 3 8 7 4 5 6" >/dev/null 2>&1

This is the line for me. With this line, I tell that the 8 buttons of the protocols are to be rearranged:

  • was already 1)

2 becomes 2 (no change because MB was already 2)

3 becomes 3 (no change because RB was already 3)

4 becomes 8 (none of my mouse's buttons is numbered 4 in xev, so I replace 4 with a number unused by X: 8 )

5 becomes 7 (none of my mouse's buttons is numbered 5 in xev, so I replace 5 with a number unused by X: 7)

6 becomes 4 (xev reports UB to be 6, but I need it to be 4, so that it can be used by X)

7 becomes 5 (xev reports DB to be 7, but I need it to be 5, so that it can be used by X)

8 becomes 6 (xev reports TB to be 8; X does not use button 6 but well... maybe it will be of some use one day).


You have to adapt this command to your needs, and to the numbers xev reports. In your case, I understand you want the thumb button to replace the middle button (number 2), probably because it is easier to click on the thumb button than clicking on the wheel. In that case, using the numbers reported by xev for my mouse, I would have written (remember that TB is 8 for me):

"pointer = 1 6 3 8 7 4 5 2"


That way, button 8 becomes button 2. Cool, isn't it? And the whell button (MB) is assigned the number 6 (who knows, maybe some application will make use of it one day...)


There remains to place this command in a file, so that it gets executed each time you login to your window manager, or better yet: each time you start X. I tried to find such a place (if possible independant of the window manager I use), and I did not find it. So I finally placed the command in /etc/profile. In Mandrake8.1, it works for all users except root (but then, I never login as root, I only su, so that's OK) but in other versions of Mandrake, or other distributions, you may have to place the command somewhere else.


Note also that I executed the command with parameters -display :0 and with >/dev/null 2>&1. That's because I expect DISPLAY to be not set and errors to occur when I log in the console. If you find a better place for executing your command, where you're sure that it is executed only if X is running, then I strongly advise to replace -display :0 with -display $DISPLAY (if $DISPLAY is set of course, which it should); and please tell me about this better place :)


That's all. I hope this helps.




Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...