Showing posts with label mouse. Show all posts
Showing posts with label mouse. Show all posts

Sunday, April 27, 2008

Logitech MX1000 Mouse on Ubuntu 8.04 Linux (Hardy Heron)

I upgraded to Ubuntu 8.04 tonight but when I did, my mouse didn't work at all anymore! I just had a dead pointer. I was able to get it working previously under Ubuntu 7.10 (Getting my Logitech MX1000 Mouse to Work, Fully, on Ubuntu 7.10) but those settings no longer worked. After playing with the settings some more, removing "CorePointer" from the InputDevice line did it for me. So, I am going to write up a new, improved and simpler how-to for the Logitech MX1000 Mouse on Ubuntu 8.04 Linux (Hardy Heron). This may also work for other multiple button mice but I don't have any other multi button mice to find out.

The very first thing to do is BACKUP your /etc/X11/xorg.conf file. Want a command for that? This will copy it to your home directory as xorg.conf.backup.

cp /etc/X11/xorg.conf ~/xorg.conf.backup

If ever you need to go back to your working config, just login to the terminal failsafe mode and switch the destination and source for the command below (plus add sudo to the front). Like so:

sudo cp ~/xorg.conf.backup /etc/X11/xorg.conf


Now then, first thing to do is install or make sure you have evdev installed. evdev is a generic input driver for keyboards and mice. (Read the man page I linked to for more detailed configuration options. Look most at the Absolute Axis Configuration section.) I think evdev is installed by default but run the line below to install it either way. If it is already installed it will just say so and not change anything.

sudo apt-get install xserver-xorg-input-evdev

Next you will want to edit your xorg.conf file. You must edit it with super privileges or you will not be able to save it. To edit it in gedit, issue this command:

gksu gedit /etc/X11/xorg.conf

Add a new MX1000 InputDevice section and comment out the old mouse InputDevice section. I first thought you didn't have to comment out the old mouse section but if you don't then your buttons will get mapped to 3 and 2 instead of 9 and 8 and they will not work for forward and back.

Section "InputDevice"
Identifier "Logitech MX1000"
Driver "evdev"
Option "Name" "Logitech USB Receiver"
Option "HWHEELRelativeAxisButtons" "7 6"
EndSection

#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
The "Name" option must match the device name exactly. It is case sensitive. To determine your device name, run:

cat /proc/bus/input/devices

You will get output (along with other devices) that looks something like this:
I: Bus=0003 Vendor=046d Product=c50e Version=2500
N: Name="Logitech USB Receiver"
P: Phys=usb-0000:00:1d.3-2/input0
S: Sysfs=/devices/virtual/input/input5
U: Uniq=
H: Handlers=kbd mouse1 event5
B: EV=7
B: KEY=1f0000 0 100 38 c0000000 c0000 0 0 0
B: REL=103
The Name listed there is the same name that must match in your InputDevice section. Next, add the new Logitech InputDevice that you created in the ServerLayout section and comment out the old mouse. Do it this way so if you messed something up, you can comment out the new Logitech mouse and uncomment the old mouse to switch back.
#    Inputdevice    "Configured Mouse"
Inputdevice "Logitech MX1000"
Now just logout and log back in. Logging out seems to restart the XServer, a necessary step, but if that doesn't work you can use Ctrl + Alt + Backspace. Use caution as that will kill your X session immediately and all open programs will just get killed.

If you have any problems with this, you might want to try my previous write up from when I was running Ubuntu 7.10. I upgraded from 7.10 -> 8.04 so I may have missed some necessary steps because I'd already done them previously. I don't think I did though.

And for reference, my full /etc/X11/xorg.conf after I was done:
Section "ServerLayout"

# Uncomment if you have a wacom tablet
# InputDevice "stylus" "SendCoreEvents"
# InputDevice "cursor" "SendCoreEvents"
# InputDevice "eraser" "SendCoreEvents"
Identifier "Default Layout"
screen 0 "aticonfig-Screen[0]" 0 0
screen "aticonfig-Screen[1]" rightof "aticonfig-Screen[0]"
Inputdevice "Generic Keyboard"
# Inputdevice "Configured Mouse"
Inputdevice "Logitech MX1000"
EndSection

Section "Files"
EndSection

Section "Module"
Load "glx"
EndSection

Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
EndSection

Section "InputDevice"
Identifier "Logitech MX1000"
Driver "evdev"
Option "Name" "Logitech USB Receiver"
Option "HWHEELRelativeAxisButtons" "7 6"
EndSection

#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

Section "InputDevice"
Identifier "stylus"
Driver "wacom"
Option "Device" "/dev/input/wacom"
Option "Type" "stylus"
Option "ForceDevice" "ISDV4"# Tablet PC ONLY
EndSection

Section "InputDevice"
Identifier "eraser"
Driver "wacom"
Option "Device" "/dev/input/wacom"
Option "Type" "eraser"
Option "ForceDevice" "ISDV4"# Tablet PC ONLY
EndSection

Section "InputDevice"
Identifier "cursor"
Driver "wacom"
Option "Device" "/dev/input/wacom"
Option "Type" "cursor"
Option "ForceDevice" "ISDV4"# Tablet PC ONLY
EndSection

Section "Monitor"
Identifier "Generic Monitor"
Horizsync 30.0 - 70.0
Vertrefresh 50.0 - 160.0
Option "DPMS"
EndSection

Section "Monitor"
Identifier "aticonfig-Monitor[0]"
Option "VendorName" "ATI Proprietary Driver"
Option "ModelName" "Generic Autodetecting Monitor"
Option "DPMS" "true"
EndSection

Section "Monitor"
Identifier "aticonfig-Monitor[1]"
Option "VendorName" "ATI Proprietary Driver"
Option "ModelName" "Generic Autodetecting Monitor"
Option "DPMS" "true"
EndSection

Section "Device"
Identifier "ATI Technologies Inc RV370 5B60 [Radeon X300 (PCIE)]"
Driver "fglrx"
Busid "PCI:1:0:0"
EndSection

Section "Device"
Identifier "aticonfig-Device[0]"
Driver "fglrx"
Busid "PCI:1:0:0"
EndSection

Section "Device"
Identifier "aticonfig-Device[1]"
Driver "fglrx"
Busid "PCI:1:0:0"
Screen 1
EndSection

Section "Screen"
Identifier "Default Screen"
Device "ATI Technologies Inc RV370 5B60 [Radeon X300 (PCIE)]"
Monitor "Generic Monitor"
Defaultdepth 24
EndSection

Section "Screen"
Identifier "aticonfig-Screen[0]"
Device "aticonfig-Device[0]"
Monitor "aticonfig-Monitor[0]"
Defaultdepth 24
SubSection "Display"
Viewport 0 0
Depth 24
EndSubSection
EndSection

Section "Screen"
Identifier "aticonfig-Screen[1]"
Device "aticonfig-Device[1]"
Monitor "aticonfig-Monitor[1]"
Defaultdepth 24
SubSection "Display"
Viewport 0 0
Depth 24
EndSubSection
EndSection

Section "Extensions"
Option "Composite" "0"
EndSection

And one more thing, a good program to test out your mouse buttons to figure out what is what is xev. The forward and back buttons should show as 9 and 8. Your left button is 1, right is 3 and pressing the scroll wheel is 2.



Sunday, December 9, 2007

Getting my Logitech MX1000 Mouse to Work, Fully, on Ubuntu 7.10

Updated: I had some problems with this in Ubuntu 8.04 so I wrote a simpler explanation with 1 tweak that works for me again: Logitech MX1000 Mouse on Ubuntu 8.04 Linux (Hardy Heron)

So my current project is to get all (or at least the forward and back) buttons working on my Logitech MX1000 Wireless Mouse on my home system. The vanilla install of Gutsy Gibson sets up the mouse so that it works (scroll wheel too) but just only as much as any other basic scroll mouse.

So before starting on this, the mouse is currently configured (in /etc/X11/xorg.conf) like so:

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
I've found many different tutorials on how to do this. Many of them involve finding and setting up the physical location of the mouse and then using xbindkeys and xvkbd to map things. If you want to see those for any reason, they were here, here and here (the last link was done on Ubuntu 5.04). They all have 1 thing in common though which is they all use evdev, the generic Linux input driver instead of the very limited ImPS/2 protocol.

The final tutorial I found turned out the be the simplest. Enabling all of the functions on your Logitech MX1000 mouse

First, I installed a few packages by running: sudo apt-get install xvkbd xbindkeys xmacro
  • xvkbd is a virtual keyboard program for X
  • xbindkeys is a program that allows you to launch shell commands with your keyboard or your mouse under X
  • xmacro is for recording and replaying keyboard and mouse events X
I am not sure if I actually need those packages for the mouse to work but I had already installed them so I am leaving it alone.

Next, In my xorg.conf I commented out (use the # to comment lines out) the default InputDevice section and created a new one like so:
Section "InputDevice"
Identifier "Logitech MX1000"
Driver "evdev"
Option "Name" "Logitech USB Receiver"
Option "HWHEELRelativeAxisButtons" "7 6"
EndSection
Then in the ServerLayout section I commented out the line Inputdevice "Configured Mouse" and added the line Inputdevice "Logitech MX1000" "CorePointer". (4/26/08 - Hardy Update, Don't include the "CorePointer" part of this line.) The Identifier in the InputDevice section needs to match the InputDevice name in the ServerLayout section so I assume if I had just named this new one "Configured Mouse" I would not have needed to change the ServerLayout section except to add it was the CorePointer.

Also, the other important thing is the Name in the InputDevice section. That must match (CASE SENSITIVE) the name of your mouse. From other examples I think it is always "Logitech USB Receiver" for the MX1000 but just to be safe, run this command cat /proc/bus/input/devices and look for your mouse. Mine looks like this:
I: Bus=0003 Vendor=046d Product=c50e Version=2500
N: Name="Logitech USB Receiver"
P: Phys=usb-0000:00:1d.3-2/input0
S: Sysfs=/class/input/input3
U: Uniq=
H: Handlers=kbd mouse1 event3
B: EV=7
B: KEY=1f0000 0 100 38 c0000000 c0000 0 0 0
B: REL=103
So after doing all that, I restarted X with the good old Ctrl-Alt-Backspace and my forward and back buttons work. I honestly don't know if that made all the other buttons work though as I don't use them so I am not even sure what they do in Windows. You can also change some settings in Firefox so that the Forward and Back buttons scroll horizontally instead but since my whole reason for doing this was to get the Forward and Back buttons to work as Forward and Back buttons, I find that stupid. I use Forward and Back so much more than I would ever need to scroll horizontally!