I once had my mouse plugged in via the PS/2 connector and used the "ExporerPS/2" protocol in my xorg.conf file, this generally worked but the little scroll up button would also make Firefox go back a page. This is not a bug this is because the "ExporerPS/2" is made for Microsoft mice not Logitech. So what can we do about it? Well first off you need to plug your mouse into a USB port, you can't do anything else in this how to until you do that. I have unplugged my mouse from the PS/2 port and plugged it into a USB port while logged into my desktop and it worked fine so go ahead and do that now.
1. Getting all the information you need
Great, so we're all plugged in via USB and ready to go. Before we change anything we need to get some important information about the mouse so run the following command in your favourite terminal:
Code:
cat /proc/bus/input/devices
You should get a list of details, here's what I get and I'll highlight the bit we need to concentrate on:
Code:
endy@ananke:~$ cat /proc/bus/input/devices
I: Bus=0003 Vendor=046a Product=0023 Version=0027
N: Name="046a:0023"
P: Phys=usb-0000:00:02.0-7/input0
H: Handlers=kbd event0
B: EV=120003
B: KEY=7 ff800000 7ff e0b2ffdf 1cfffff ffffffff fffffffe
B: LED=1f
I: Bus=0003 Vendor=046a Product=0023 Version=0027
N: Name="046a:0023"
P: Phys=usb-0000:00:02.0-7/input1
H: Handlers=kbd event1
B: EV=f
B: KEY=1 0 38000 39fa d841d7a9 9e0000 0 0 0
B: REL=40
B: ABS=ffffff01 0
I: Bus=0003 Vendor=046d Product=c01d Version=2100
N: Name="Logitech USB-PS/2 Optical Mouse"
P: Phys=usb-0000:00:02.0-8/input0
H: Handlers=mouse0 event2 ts0
B: EV=7
B: KEY=ff0000 0 0 0 0 0 0 0 0
B: REL=103
I: Bus=0010 Vendor=001f Product=0001 Version=0100
N: Name="PC Speaker"
P: Phys=isa0061/input0
H: Handlers=kbd event3
B: EV=40001
B: SND=6
We know this is the correct bit because the name "Logitech USB-PS/2 Optical Mouse". Your output will be different but the bit I've highlighted is all we need.
Note: For mx700 users the mouse name is "Logitech USB Receiver", thanks to everyone for the info!
2. Editing the xorg.conf file
Now we have the information we need to start to set up xorg. So open up your xorg.conf file in your favourite editor, mine is leafpad but as gedit is on everyone elses install by default you can type:
Code:
sudo gedit /etc/X11/xorg.conf
Now scroll down to the mouse section and instead of deleting it we're going to comment it out, to do this you put a "#" in front of each line in the section, again here is my commented section as an example:
Code:
#Section "InputDevice"
# Identifier "Configured Mouse"
# Driver "mouse"
# Option "CorePointer"
# Option "Device" "/dev/input/mice"
# Option "Protocol" "ImPS/2"
# Option "Emulate3Buttons" "true"
# Option "ZAxisMapping" "4 5"
#EndSection
Again, yours might look different, the important bit is to comment the whole section out, but only this section.
Next up we want to paste in out new section, make a but of room underneath (or above if you prefer) that section we just commented out and paste in the following template:
Code:
Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "Protocol" "evdev"
Option "Dev Name" "Logitech USB-PS/2 Optical Mouse"
Option "Dev Phys"
Option "Device"
Option "Buttons" "10"
Option "ZAxisMapping" "4 5"
EndSection
If, when you read the details of the mouse (above) it printed a different name to "Logitech USB-PS/2 Optical Mouse" then edit that so it's right, but I suspect it will be the same. Next you'll have probably noticed there are two fields missing, "Dev Phys" and "Device". We'll fill this in now.
"Dev Phys" needs the detail from the "Phys" line from the output before, so if you look back at my example mine said "Phys=usb-0000:00:02.0-7/input1" so I would put "usb-0000:00:02.0-7/input1" in or better yet as we can use wild cards I would use "usb-*/input0" which, if anything else, looks better
"Device" needs the detail from the "Handlers" line, again my example was "Handlers=mouse0 event2 ts0", this time all we need it the name of what "event" it is. For me it's "event2" but before we add it to the xorg.conf file we need to make sure we use the full path which will be "/dev/input/event2".
DancingSun wisely pointed out that the button numbers after "ZAxisMapping" should be the values of the scroll wheel up and down. Use the "xev" tool in a terminal to check which button numbers these are. That is, you run "xev" in a terminal, hover the mouse over the pop up window and on the mouse push the scroll wheel up. The last line of the output in the terminal will tell you what button number you just pressed. Here is a sample from running xev, I've highlighted the button number:
Code:
ButtonPress event, serial 29, synthetic NO, window 0x3a00001,
root 0x134, subw 0x0, time 10223576, (111,54), root:(126,151),
state 0x0, button 4, same_screen YES
ButtonRelease event, serial 29, synthetic NO, window 0x3a00001,
root 0x134, subw 0x0, time 10223576, (111,54), root:(126,151),
state 0x800, button 4, same_screen YES
Note the button number down and do the same for the scroll wheel down then put it in the xorg.conf file, scroll up goes first, then scroll down. For mx510 users the above "4 5" is correct.
DancingSun also has posted a great way to find out exactly how many mouse buttons you actually have for the "Buttons" setting in your xorg.conf file, it's explained best in DancingSun's post which you can read
here. Thanks again DancingSun!
Note: mx700 users report the name needs to be "Logitech USB Receiver" not "Logitech USB-PS/2 Optical Mouse" like it is for my mx510. Please refer to your output from "cat /proc/bus/input/devices" to be sure. Additionally, iverson0881 found that for the mx700 you can use "/dev/input/ts0" to work. Again check your output from earlier as you may need to change it to "ts1" or "ts2" etc... You can see iverson0881's post here.
Make sure you save the changes to your xorg file.
So to conclude, here is my example with everything filled in:
Code:
Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "Protocol" "evdev"
Option "Dev Name" "Logitech USB-PS/2 Optical Mouse"
Option "Dev Phys" "usb-*/input0"
Option "Device" "/dev/input/event2"
Option "Buttons" "10"
Option "ZAxisMapping" "4 5"
EndSection
Note: If you have another mouse with more or less buttons then you may will have to correct the "Buttons" and "ZAxisMapping" numbers, but mine are correct for the mx510. It may not seem like it has ten buttons but it does if you count every single button
3. Restart X
Warning!
Don't restart X yet! Just before we do I have to warn you if you made a mistake in the xorg file X will not restart. But don't worry that's why we only commented out the previous settings and didn't delete them. If X fails to restart then you will end up in a text console. Log in and type the following to edit the xorg file:
Code:
sudo nano /etc/X11/xorg.conf
All you need to do is comment out the new section we just added by putting a "#" in front of each line and un-commenting the original section by deleting the "#" which is at the start of each line. Save the xorg file in nano by typing "CTRL + X" press "Y" to confirm the save and type "startx" to get back to your desktop and re-read section two carefully and correct your xorg file.
Ok, I'm ready
Now we're prepared, restart X by pressing "CTRL + ALT + BACKSPACE" simultaneously and hopefully after a moment you can log back in.
4. Editing the Xmodmap file
** THIS SECTION IS REDUNDANT, SKIP TO SECTION 2 BELOW ** as DancingSun pointed out, using correct "ZAxisMapping" settings in your xorg.conf file is the correct way to have your scroll wheel work. See above about editing your xorg file, I will leave this section here for reference.
Note: prelude has found you don't necessarily need this step if you are using an mx1000. Thanks prelude!
You probably already have an Xmodmap file but now we have more buttons available we need to correct it. Open it up with your text editor:
and paste the following, overwriting any previous "pointer" line:
Code:
pointer = 1 2 3 6 7 8 9 10 4 5
Now run xmodmap to apply these settings:
If this is the first time you created a .Xmodmap file then next time you log into gnome it will ask you if you want to automatically load it, add the file and click Ok if this happens.
Now all the buttons should work properly including the little up button above the scroll wheel. The side buttons should also make Firefox go forward and backward a page just like before but they will not work in Nautilus yet. Keep reading to see how to get that to work!
Note: Again, if you're mouse has more or less buttons then you'll need to figure out what button numbers are the two side buttons, you can do this with the utility "xev" which you run from the terminal, hover the mouse over the pop up box and hold it still and press the side buttons. You'll see some output part of which is a button number. The two button numbers for you mouse go last in the .Xmodmap file, look at mine as an example.
First of all some people use a program called LMCtl instead, but I've never had it working so I use logitech_applet, which isn't an applet by the way
This section is for making sure your mouse is using the best resolution it can, making it more accurate which is pretty handy especially in games where that counts like Quake 3
1. Getting everything we need
There is no logitech_applet in Synaptic so I just download the source and use the program "checkinstall" to package it and install it, you'll also need the "build-essential" packages which can be quite large so bear this in mind and the "libusb-dev" library. Once this is done you can uninstall it if you want via Synaptic. Ok so lets download and install logitech_applet:
Code:
sudo apt-get install checkinstall build-essential libusb-dev
wget http://freshmeat.net/redir/logitech_applet/53319/url_tgz/logitech_applet-0.4test1.tar.gz
tar xvfz logitech_applet-0.4test1.tar.gz
mv ./logitech_applet-0.4test1 ./logitech-applet-0.4test1
cd ./logitech-applet-0.4test1
./configure --prefix=/usr
make
sudo checkinstall
Just hit enter when checkinstall prompts you. Now it should be installed
2. Working logitech_applet
I use the command "logitech_applet -s 800 -e" which you can run now:
Code:
sudo logitech_applet -s 800 -e
This sets the mouse resolution to it's maximum 800cpi and makes sure the "cruise control" is enabled, you'll probably have to adjust the mouse settings in gnome as it should be much more accurate now. Type "logitech_applet --help" for more information.
3. Load on boot
We need to add this to a start up script so it's done automatically when the machine boots up, to do this I make a file in /etc/init.d/local where I keep local settings, so lets make that now:
Code:
sudo gedit /etc/init.d/local
Now paste the logitech_applet command, mine like the example above is:
Code:
echo "Setting up Logitech mouse..."
logitech_applet -s 800 -e
I have the echo line so I can check if it works in the boot messages, it's nice but you don't need it.
To make it executable run the following command:
Code:
sudo chmod 755 /etc/init.d/local
Now run the following command to make the "local" script run when the system boots:
Code:
sudo update-rc.d local defaults
Now the applet loads automatically on boot, huzzah!
Bookmarks