Logitech MX1000

From ArchWiki
Revision as of 22:24, 27 August 2007 by Mac57 (Talk | contribs) (Enabling Forward, Back and Horizontal Scroll on Logitech MX1000 Laser Mouse)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Disclaimer: this information is current as of Arch Linux 2007.08 (Don't Panic). For later releases, your mileage may vary. In the true spirit of a Wiki, if you determine that this content needs to be updated for a later release, please go ahead and do so!

Get, Install evdev

First, use evdev as the Xorg mouse driver. Get this module, install it, and make sure it is loaded each time you run Linux.

For Arch, this means:

# pacman --sync xf86-input-evdev

and adding "evdev" to the modules list in /etc/rc.conf.

Modify xorg.conf to Use evdev as Your Mouse Driver

Next, in /etc/X11/xorg.conf, create an evdev-based input device that specifies your mouse:

# evdev based section for Logitech MX1000 mouse

Section "InputDevice"
   Identifier  "Evdev Mouse"
   Driver      "evdev"
   Option      "Name" "Logitech USB Receiver"
   Option      "CorePointer"

Note: then "Name" field above is important. Find out the name for your device via:

# egrep "Name|Handlers" /proc/bus/input/device

In the case of the Logitech MX1000 mouse, which is wireless, it is: "Logitech USB Receiver".

Modify Xorg ServerLayout to Use Your evdev Mouse

Now modify the Xorg server layout to use this mouse entry:

Section "ServerLayout"
   Identifier     "Xorg Configured"
   Screen         0  "Screen0" 0 0
   InputDevice    "Keyboard0" "CoreKeyboard"
   InputDevice    "Evdev Mouse" "CorePointer"
# PS/2 Mouse not detected
# Serial Mouse not detected

Map The Forward and Back Functions Onto the Forward and Back Buttons

Next, add the following to your .xinitrc, or somewhere where it will be executed each time X starts:

# xmodmap -e "pointer = 1 2 3 4 5 8 9 6 7"

You will receive the warning:

   Warning: Only changing the first 9 of 20 buttons.

Don't worry about this - it is normal.

Finally, to get those pesky Forward and Back buttons working in some Gnome apps such as Nautilus, get and install xvkbd and xbindkeys.

For Arch, this means:

# pacman --sync xvkbd
# pacman --sync xbindkeys

Now create file ~/.xbindkeysrc, containing:

# Mouse Buttons
"/usr/bin/xvkbd -xsendevent -text "\[Alt_L]\[Left]""
m:0x0 + b:6 
"/usr/bin/xvkbd -xsendevent -text "\[Alt_L]\[Right]""
m:0x0 + b:7

and add the following to your .xinitrc, or somewhere where it will be executed each time X starts:

% xbindkeys

Enable Horizontal Scrolling

The MX1000 comes with a tilting scroll wheel. If you tilt it to the left, the intent is that the screen should scroll to the left. Tilt it to the right and the screen should scroll to the right. To get these functions working, we need to fall back to an old friend, xev, and get it to tell us what each of these scroll wheel events generates. We will then map that to the desired keystrokes needed to cause the screen to scroll left and scroll right actions.

But wait, what are those keystrokes? You have to determine that through trial and error unfortunately. For Firefox, you can determine through trial and error that a left arrow key scrolls the screen the left while a right arrow key scrolls it to the right. So, we want to map whatever event tilting the scroll wheel left produces to "left arrow" and whatever event tilting the scroll wheel to the right produces to "right arrow".

To find out what events are being producted, start up an xterm and enter the following:

# xev | grep -i button

Now move your mouse pointer to the xev window and tilt the wheel left. Record the button number. If all is right with the universe, it should be button number 13. Now repeat for the right tilt. This should produce button number 14.

To map button 13 to "left arrow" and button 14 to "right arrow", simply add to the .xbindkeys file we created above in step 4. In this case, add the following:

"/usr/bin/xvkbd -xsendevent -text "\[Left]""
m:0x0 + b:13
"/usr/bin/xvkbd -xsendevent -text "\[Right]""
m:0x0 + b:14

That is it. Restart X and you will find that left and right scrolling now work just fine!

All done! Simple n'est pas? :-)