个人工具

UbuntuHelp:MX1000Mouse

来自Ubuntu中文

跳转至: 导航, 搜索

Enabling all of the functions on your Logitech MX1000 mouse

This guide will guide you through the process of enabling all 12 buttons on your logitech mx1000 mouse, including the side buttons, side scroll and cruise control (aka auto vertical scroll) functionality.

Before you start

Install the necessary packages

In a terminal (you will need the universe repository enabled):
sudo apt-get install xvkbd xbindkeys xmacro

Edgy Eft 6.10, Feisty Fawn 7.04, Gutsy Gibbon 7.10, Hardy Heron 8.04, and Intrepid Ibex 8.10

Users of Edgy Eft 6.10 and later should also execute the following command in a terminal:
sudo apt-get install xserver-xorg-input-evdev

Disable xmodmap pointer

IconsPage?action=AttachFile&do=get&target=IconWarning3.png If you have previously used xmodmap to change the way X uses the mouse buttons, please disable it. It is usally done by setting pointer = [list of numbers] in ~/.xmodmaprc. Just remove that line from where you set it.

Set up evdev

Intrepid Ibex 8.10

Skip to the next section. Evdev is used by default with the new init-hotplug.

Gutsy Gibbon 7.10 and Hardy Heron 8.04

  • First, let's make a backup of your xorg.conf and then open it up for editing. In a terminal:

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup gksudo gedit /etc/X11/xorg.conf

  • Find the section that looks like:

Section "InputDevice"

      Identifier	"Configured Mouse"

... EndSection

  • Go ahead and delete this section (don't worry we made the backup in case anything goes wrong) and replace it with the following:

Section "InputDevice"

       Identifier      "Logitech MX1000"
       Driver          "evdev"
       Option          "Device"    "/dev/input/by-id/usb-Logitech_USB_Receiver-event-mouse"
       Option          "HWHEELRelativeAxisButtons" "7 6"
EndSection

IconsPage?action=AttachFile&do=get&target=IconWarning3.png Check "/dev/input/by-id/" to make sure you have "usb-Logitech_USB_Receiver-event-mouse" and update your configuration accordingly.

  • Find the section that looks like:

Section "ServerLayout" ... EndSection

  • Remove any lines that refer to "Configured Mouse" and replace it with the following line:
InputDevice "Logitech MX1000" "SendCoreEvents"
  • Save your changes and exit.
  • Restart X by logging out and back in, or typing sudo /etc/init.d/gdm restart.

IconsPage?action=AttachFile&do=get&target=IconNote.png If X refuses to start, it means you probably made a typo. To fix this, just restore the backup copy of xorg.conf: sudo rm /etc/X11/xorg.conf; sudo cp /etc/X11/xorg.conf.backup /etc/X11/xorg.conf. Then start X again and check your xorg.conf for errors.

Dapper Drake 6.06, Edgy Eft 6.10, and Feisty Fawn 7.04

  • Execute the following command in the terminal:

cat /proc/bus/input/devices

Make note of the name reported for the reciever.

For example:
Name="Logitech USB Receiver" 

You will use this name when editing your xorg.conf below. The name is case sensitive, so copy and paste exactly what is reported in the terminal. Be careful it is case sensitive and Logitech used more names also like: Name="Logitech USB RECEIVER"

  • First, let's make a backup of your xorg.conf and then open it up for editing. In a terminal:

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup gksudo gedit /etc/X11/xorg.conf

  • Find the section that looks like:

Section "InputDevice"

      Identifier	"Configured Mouse"

... EndSection

  • Go ahead and delete this section (don't worry we made the backup in case anything goes wrong) and replace it with the following:

Section "InputDevice"

       Identifier      "Logitech MX1000"
       Driver          "evdev"
       Option          "Name"          "Logitech USB Receiver"
       Option          "HWHEELRelativeAxisButtons" "7 6"
EndSection The "Name" is case sensitive and should be exactly the same as the one shown by
cat /proc/bus/input/devices

Otherwise X will refuse to start. IconsPage?action=AttachFile&do=get&target=IconWarning3.png We are only identifying the device using it's "Name". If this is a problem for you because other devices also identify themselves this way, post at the forum link found at the bottom of this page.

  • Find the section that looks like:

Section "ServerLayout" ... EndSection

  • Remove any lines that refer to "Configured Mouse" and replace it with the following line:
InputDevice "Logitech MX1000" "CorePointer"

Alternatively, you can specify "SendCoreEvents" instead of "CorePointer", if for instance you use a laptop and the mx1000 mouse is not always plugged in. See man xorg.conf for more information.

  • Save your changes and exit.
  • Restart X by logging out and back in, or typing sudo /etc/init.d/gdm restart.

IconsPage?action=AttachFile&do=get&target=IconNote.png If X refuses to start, it means you probably made a typo. To fix this, just restore the backup copy of xorg.conf: sudo rm /etc/X11/xorg.conf; sudo cp /etc/X11/xorg.conf.backup /etc/X11/xorg.conf. Then start X again and check your xorg.conf for errors.

Breezy Badger 5.10

  • First, we need to get some information about the mouse. In a terminal:

cat /proc/bus/input/devices

  • In my case the output was
 jasonr@luso:~$ cat /proc/bus/input/devices
 I: Bus=0011 Vendor=0001 Product=0001 Version=ab41
 N: Name="AT Translated Set 2 keyboard"
 P: Phys=isa0060/serio0/input0
 H: Handlers=kbd event0
 B: EV=120013
 B: KEY=1 80000004 2000000 3002078 f840d001 f2ffffdf ffefffff ffffffff fffffffe
 B: MSC=10
 B: LED=7

*I: Bus=0003 Vendor=046d Product=c50e Version=2500
*N: Name="Logitech USB Receiver"
*P: Phys=usb-0000:00:1d.0-1/input0
*H: Handlers=mouse0 event1 ts0
*B: EV=7
*B: KEY=ffff0000 0 0 0 0 0 0 0 0
*B: REL=143

 I: Bus=0010 Vendor=001f Product=0001 Version=0100
 N: Name="PC Speaker"
 P: Phys=isa0061/input0
 H: Handlers=kbd event2
 B: EV=40001
 B: SND=6

 jasonr@luso:~$

IconsPage?action=AttachFile&do=get&target=IconHint2.png We're interested in the section concerning the mouse (which is marked above by *'s). Specifically, we want three pieces of information: Name, Phys, and Handlers. IconsPage?action=AttachFile&do=get&target=IconWarning3.png Your information may be different than mine so do not assume that you can just use the values displayed above.

  • Now we need to actually use this information and edit xorg.conf. Let's make a backup and then open it up for editing. In a terminal:

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup gksudo gedit /etc/X11/xorg.conf

  • Find the section that looks like:

Section "InputDevice"

      Identifier	"Configured Mouse"

... EndSection

  • Go ahead and delete this section (don't worry we made the backup in case anything goes wrong) and replace it with the following template:
Section "InputDevice"
       Identifier	"Configured Mouse"
       Driver		"mouse"

Option "CorePointer" Option "Protocol" "evdev" Option "Dev Name" "Logitech USB Receiver" Option "Dev Phys"

       Option		"Device"		

Option "Buttons" "12" Option "ZAxisMapping" "4 5 7 6"

EndSection
  • Now look at the information you gathered above with the cat /proc/bus/input/devices command. If Name was the same as "Logitech USB Receiver", then you can leave the "Dev Name" line alone since it is the same as the template. If it is different, then change "Logitech USB Receiver" appropriately.
  • Look at the Phys section of the information. In the "Dev Phys" line in your xorg.conf file add the appropriate option. In my case I got Phys=usb-0000:00:1d.0-1/input0 and so I would add "usb-*/input0" (see below for a completed template). What matters here is the input[NUMBER] part, we can use a wildcard for the 0000:00:1d.0-1 part.
  • The last piece of information we are going to use is Handlers. In my case, Handlers was "mouse0 event1 ts0". We only care about the event[NUMBER] part. In my case I would add "/dev/input/event1" to the "Device" line. If your Handlers had event0 in it, then you would add "/dev/input/event0", etc.
IconsPage?action=AttachFile&do=get&target=IconExample48.png The finished product should look similar to:
 Section "InputDevice"
        Identifier	"Configured Mouse"
        Driver		"mouse"
	Option		"CorePointer"
	Option		"Protocol"		"evdev"
	Option		"Dev Name"		"Logitech USB Receiver"
	Option		"Dev Phys"		"usb-*/input0"
        Option		"Device"		"/dev/input/event1"
	Option		"Buttons"		"12"
	Option		"ZAxisMapping"		"4 5 7 6"
 EndSection
  • Save your changes and exit.
  • Restart X by logging out and back in, or typing sudo /etc/init.d/gdm restart.

IconsPage?action=AttachFile&do=get&target=IconWarning3.png If X refuses to start, it means you probably made a typo. To fix this, just restore the backup copy of xorg.conf: sudo rm /etc/X11/xorg.conf; sudo cp /etc/X11/xorg.conf.backup /etc/X11/xorg.conf. Then start X again and check your xorg.conf for errors.

Set up Firefox

  • Now let's tell firefox we want it to use sidescroll.
  • Enter about:config in your address bar in firefox and press enter.
  • Change the value of mousewheel.horizscroll.withnokey.action to 0.
  • Change mousewheel.horizscroll.withnokey.sysnumlines to true

IconsPage?action=AttachFile&do=get&target=IconHint2.png Alternatively, you may leave this setting as false and use mousewheel.horizscroll.withnokey.numlines to specify a custom number. IconsPage?action=AttachFile&do=get&target=IconNote.png At this point your mouse should have side scroll and cruise control working. Go ahead and try it in firefox if you'd like. However, the side buttons won't go back and forward in your history and the cruise control will highlight text as it scrolls vertically. We are going to take care of those problems now.

Side buttons and Nautilus, Epiphany, Konqueror

Set up xbindkeys

Dapper Drake 6.06, Edgy Eft 6.10, and Feisty Fawn 7.04

  • In a terminal:
gedit ~/.xbindkeysrc
  • Paste the following into your new file:

"/usr/bin/xvkbd -xsendevent -text "\[Alt_L]\[Left]""

 b:8

"/usr/bin/xvkbd -xsendevent -text "\[Alt_L]\[Right]""

 b:9

"echo ButtonRelease 11 ButtonPress 4 ButtonRelease 4 | xmacroplay -d 0 :0.0"

 b:11

"echo ButtonRelease 12 ButtonPress 5 ButtonRelease 5 | xmacroplay -d 0 :0.0"

 b:12

"echo ButtonRelease 13 ButtonPress 6 ButtonRelease 6 | xmacroplay -d 0 :0.0"

 b:13

"echo ButtonRelease 14 ButtonPress 7 ButtonRelease 7 | xmacroplay -d 0 :0.0"

 b:14
  • Save your changes and exit.
  • Add xbindkeys to your startup programs in the System -> Preferences -> Sessions -> Startup Programs

IconsPage?action=AttachFile&do=get&target=IconHint2.png So that you don't have to reboot, you can just run xbindkeys & in a terminal.

Breezy Badger 5.10

  • In a terminal:
gedit ~/.xbindkeysrc
  • Paste the following into your new file:

"/usr/X11R6/bin/xvkbd -xsendevent -text "\[Alt_L]\[Left]""

  b:8

"/usr/X11R6/bin/xvkbd -xsendevent -text "\[Alt_L]\[Right]""

  b:9

"echo ButtonRelease 11 ButtonPress 4 ButtonRelease 4 | xmacroplay -d 0 :0.0"

  b:11

"echo ButtonRelease 12 ButtonPress 5 ButtonRelease 5 | xmacroplay -d 0 :0.0"

b:12
  • Save your changes and exit.
  • Add xbindkeys to your startup programs in the System -> Preferences -> Sessions -> Startup Programs

IconsPage?action=AttachFile&do=get&target=IconHint2.png So that you don't have to reboot, you can just run xbindkeys & in a terminal.

Final Remarks

Try out all of the buttons on your mouse now. The side buttons should let you go back and forward in your history. And the side scroll and cruise control should be working perfectly. I haven't found a good use for that third side button but you can setup a bind for it with xbindkeys (it should be "b:10").

See also