|
![]() |
Overclock.net - Overclocking.net > Software, Programming and Coding > Operating Systems > Linux, Unix | |
[FAQ] Getting Mouse Side Buttons to work in Linux
|
||
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) | ||||||||||||||
|
Fear is the heart of Love
![]() |
There is more than one way to getting your extra mouse buttons to work in Linux. However the results vary from mouse to mouse, and there is no guarantee that any of these tricks will work.
First off if you like to use those extra side buttons to navigate in a browser( Example: back and forward). Then you might find that firefox already does this for you. This is because firefox has that feature hardcoded in. So it may work from the start for you. If not then here is something you can try. You will have to make some edits to your xorg.conf file. So before you make ANY changes to xorg.conf make sure to make a backup of it in case you mess up or it doesn't work you can restore your original configuration. To backup your current configuration Code:
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup Code:
sudo mv /etc/X11/xorg.conf.backup /etc/X11/corg.conf Find the section that looks like this: Section "InputDevice" Identifier "Configured Mouse" Driver "mouse" Option "CorePointer" Option "Device" "/dev/input/mice" Option "Protocol" "ImPS/2" Option "ZAxisMapping" "4 5" Option "Emulate3Buttons" "true" EndSection It should look something like that. First thing you can change is to comment out the line that says Option "Emulate3Buttons" "true". Since your mouse probably has a scroll wheel. So it would now look like this: #Option "Emulate3Buttons" "true" Next, make sure the Driver Xorg is using is the “mouse” driver. This is already correct in the above example code. You can leave the Option “CorePointer” there, and the same with the Option “Device”. You do NOT want to change this if your mouse is already working. However, if your mouse is not working then you would want to change the location path (Example of other location paths you might try: /dev/mouse, /dev/input/mouse) The next thing you will want to change is the Option “Protocol”. You will want to replace “ImPS/2” (or what ever is there) with “ExplorerPS/2”. So the line would look something like this: Option "Protocol” “ExplorerPS/2” Now you want to add the follow option in with the others: Option “Buttons” “7” The number of buttons depends on the number of buttons on your mouse, but remember that the scroll wheel counts as 3. Make sure the option “ZAxisMapping” is present and has the parameter “4 5”. If your mouse has two scroll wheels or a mouse that has a scroll that tilts side to side then you can try the parameter “4 5 6 7”. So either: Option “ZAxisMapping” “4 5” -OR- Option “ZAxisMapping” “4 5 6 7” (depending on your needs) Also one other thing you can add is the resolution, that is if your mouse supports a high resolution, like most current gaming mice do. Just add: Option “Resolution” “1800” (the 1800 can be what ever the highest you mouse can support, for mine thats 1800). That is all for the xorg.conf file so save it, but before you restart Xorg, you still should do a few more things to make your life easier. Using you favorite simple text editor (Example: vi, vim, nano, gedit, kate) open a new text document and type: pointer = 1 2 3 4 5 6 7 Now save this text file as .xmodmap and save it in your home directory (Example: /home/username).(Remember “username” needs to be replaced by your real username) Now if your a KDE user, you can do the following: Add the following into a new text file: xmodmap ~/.xmodmap and save it as startup.sh is the following directory: /home/username/.kde/Autostart And in a terminal type: chmod +x /home/username/.kde/Autostart/startup.sh Now the command: xmodmap ~/.xmodmap, is run everytime you log into KDE. For Gnome users, you should be able to do the same instructions for the KDE users, but just change the location where you save the file startup.sh. However I am not that similar with Gnome, so I am not sure if there is an Autostart folder or not. If you are not a KDE user and a confused Gnome user, then you can try the following. See if the file .xinitrc exist in one of the two following locations: /root , or /home/username To see if its there, try running the following two commands in the terminal: sudo ls -a /root/ | sed -n /.xinitrc/p <-need to be root, so thats why sudo is added. ls -a ~/ | sed -n /.xinitrc/p <-run as your normal user If one of these locations has the .xinitrc file then open it in your favorite text editor: (NOTE: If the file .xinitrc is in both of these locations, then you can either edit both of them or the one that is in the users account home that you log into the most. Changing it in one location doesn't change it in the other). Example (in a terminal): kate /path/.xinitrc (add sudo to the front if .xinitrc is in the directory /root) Now add the following line to .xinitrc: xmodmap /path/to/file/.xmodmap Save .xinitrc. The file .xinitrc is ran everytime Xorg is started. NOTE: If you are a KDE user and you have a .xinitrc file, then it does not matter which of the above methods you choose. Just don't add it to both. Now that this is all done you can restart Xorg (either by login out and then back in or by pressing <ctrl>+<alt>+<backspace key>). Now in a web browser you should hopefully be able to use the thumb buttons on your mouse as back and forward buttons. If you wanted to use the extra mouse buttons to execute a program then look into a program called IMWheel. Home Page: http://imwheel.sourceforge.net/ Some one else's Howto on it can be seen here: http://legroom.net/howto/mouse I didn't feel like writing anything up on that since I have little experience with IMWheel. Some thing that might help you if you want to use IMWheel: http://imwheel.sourceforge.net/imwheelrc Again I just want to say that there is no guarantee that any of the above will work, but I am able to have my thumb buttons on my mouse work as back and forward. Mouse is a Logitech MX518.
__________________
"UNIX was never designed to keep people from doing stupid things, because that policy would also keep them from doing clever things." - Doug Gwyn Try out the latest Programming Challenge Quote:
CPU-Z Validation @ 2.97-prime95 stable 16 hours @ 1.48v Proof | CPU-Z Validation @ 3.15 Getting Mouse Side Buttons to work in Linux, Compile a custom Kernel, More
Last edited by dangerousHobo : 06-23-07 at 06:46 PM. |
||||||||||||||
|
|
|
|
#2 (permalink) | |||||||||||||
|
Multi-Quote King
|
I tried this method here:
__________________http://forums.fedoraforum.org/archiv...p/t-27470.html It worked half-assedly. It gave me forward/backward on my mouse, but only via the scroll wheel (up on the scroll wheel = back one page, down on scroll wheel = forward one page). Any way to mod that to get it to work for the side buttons? That method is the closest i got to getting this to work.
|
|||||||||||||
|
|
|
|
#3 (permalink) | ||||||||||||||
|
Fear is the heart of Love
![]() |
You can try playing around with this option: Option "ZAxisMapping" "4 5"
Could try: Option "ZAxisMapping" "4 5 6 7" Option "ZAxisMapping" "6 7 4 5" ect..
__________________
"UNIX was never designed to keep people from doing stupid things, because that policy would also keep them from doing clever things." - Doug Gwyn Try out the latest Programming Challenge Quote:
CPU-Z Validation @ 2.97-prime95 stable 16 hours @ 1.48v Proof | CPU-Z Validation @ 3.15 Getting Mouse Side Buttons to work in Linux, Compile a custom Kernel, More
|
||||||||||||||
|
|
|
|
#4 (permalink) | |||||||||||||
|
Linux Lobbyist
|
Quote:
and as for copy, paste or the internet shortcut keys, try xbindkeys you could even use your ir remote w/o lirc
__________________
|
|||||||||||||
|
|
|
|
#5 (permalink) | |||||||||||||
|
Multi-Quote King
|
Argh, other combos end up in either my other mouse buttons not having any function or my scroll wheel doing the forward/backwarding. If it helps, i have an MX518. It's got 2 clicks, 1 wheel button, 1 up wheel, 1 down wheel (same wheel, just its 3 functions), 1 sensitivity up button, 1 sensitivity down button and 1 "window switcher" button. So should i put it as a 10 button mouse or 8 button mouse or keep it as a 7 button? I mean could it be reading the buttons wrong since i don't have exactly 7 buttons like i'm specifying?
__________________
|
|||||||||||||
|
|
|
|
#6 (permalink) | |||||||||||||
|
Linux Lobbyist
|
Nice work Hobo, I have a Razer Diamondback (waste of money maybe? not as much as the Copperhead.) and all the buttons have always worked from install except that the right side buttons act as a scroll wheel, I heard somewhere that this is also the default action in Windows and is changed with the Razer software. I am fairly confident my xorg.conf is correct (I created it as it is before seeing this article but it seems to fit with the info here)
Code:
Section "InputDevice"
# generated from data in "/etc/conf.d/gpm"
Identifier "Mouse0"
Driver "mouse"
Option "Name" "Razer Diamondback"
Option "Vendor" "Razer"
Option "CorePointer"
Option "Protocol" "ExplorerPS/2"
Option "Device" "/dev/input/mice"
Option "ZAxisMapping" "4 5"
Option "Buttons" "9"
Option "ButtonMapping" "1 2 3 4 5 6 7 8 9"
Option "Resolution" "1600"
Option "SampleRate" "1000Hz"
EndSection
EDIT: I have read that xorg only supports 7 button mice.
__________________
Running Windows apps through Wine? This FAQ is a must read! UPDATED
Last edited by priapus : 09-07-07 at 05:13 AM. |
|||||||||||||
|
|
|
|
|
#7 (permalink) | |||||||||||||
|
Folding Fanatic
|
Tried this under Ubuntu Gnome...crashed my X environment right after I logged out.
__________________
|
|||||||||||||
|
|
|
|
#8 (permalink) | ||||||||||||||
|
Fear is the heart of Love
![]() |
Make sure you didn't make a syntax error, just one simple error will crash X.
__________________
"UNIX was never designed to keep people from doing stupid things, because that policy would also keep them from doing clever things." - Doug Gwyn Try out the latest Programming Challenge Quote:
CPU-Z Validation @ 2.97-prime95 stable 16 hours @ 1.48v Proof | CPU-Z Validation @ 3.15 Getting Mouse Side Buttons to work in Linux, Compile a custom Kernel, More
|
||||||||||||||
|
|
|
|
#9 (permalink) | ||||||||||||||
|
Folding Fanatic
|
Quote:
I had to reinstall. I didn't know what else to do. Its ok though. I was looking for an excuse to try out Mandriva ![]()
|
||||||||||||||
|
|
|
|
#10 (permalink) | ||||||||||||||
|
Fear is the heart of Love
![]() |
Sorry to make you have to reinstall.
B/c of your problem though, it made me notice that I left an important part out of the FAQ....backing up xorg.conf first. ![]()
__________________
"UNIX was never designed to keep people from doing stupid things, because that policy would also keep them from doing clever things." - Doug Gwyn Try out the latest Programming Challenge Quote:
CPU-Z Validation @ 2.97-prime95 stable 16 hours @ 1.48v Proof | CPU-Z Validation @ 3.15 Getting Mouse Side Buttons to work in Linux, Compile a custom Kernel, More
|
||||||||||||||
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|