特殊:Badtitle/NS100:ManyButtonsMouseHowto:修订间差异

来自Ubuntu中文
跳到导航跳到搜索
Oneleaf留言 | 贡献
无编辑摘要
Wikibot留言 | 贡献
无编辑摘要
第2行: 第2行:
{{Languages|UbuntuHelp:ManyButtonsMouseHowto}}
{{Languages|UbuntuHelp:ManyButtonsMouseHowto}}
#title Configuring a Multi-Button Mouse
#title Configuring a Multi-Button Mouse
This page describes how to configure Ubuntu to fully utilize a mouse with multiple buttons, wheels, and other controls.
This page describes how to configure Ubuntu to fully utilize a mouse with multiple buttons, wheels, and other controls.
== Before You Begin ==
== Before You Begin ==
It's important to note that Ubuntu considers a standard two button, scroll/click-wheel mouse to have five buttons. Each main button (left and right) count as one, the downward click on the wheel counts as another, and the up/down scrolling also count as one each (2+1+2=5).
It's important to note that Ubuntu considers a standard two button, scroll/click-wheel mouse to have five buttons. Each main button (left and right) count as one, the downward click on the wheel counts as another, and the up/down scrolling also count as one each (2+1+2=5).
== Beyond the Basics ==
== Beyond the Basics ==
If you have installed the GNOME environment (default for Ubuntu) you ''already'' have the software needed to get the "6th" and "7th" mouse buttons working (forward/backward on most mice)!
If you have installed the GNOME environment (default for Ubuntu) you ''already'' have the software needed to get the "6th" and "7th" mouse buttons working (forward/backward on most mice)!
Open `/etc/X11/xorg.conf` or `/etc/X11/XF86Config-4` for editing. Within the `InputDevice` section for your `Configured Mouse`, change <code><nowiki>Option "Buttons" "5"</nowiki></code> to <code><nowiki>Option "Buttons" "7"</nowiki></code> (see "xorg.conf (X11 configuration file)" section below for an example). You may also have to change the `ZAxisMapping` option from `"4 5"` to `"6 7"`. Be prepared to experiment to discover what works best on your system.
Open `/etc/X11/xorg.conf` or `/etc/X11/XF86Config-4` for editing. Within the `InputDevice` section for your `Configured Mouse`, change <code><nowiki>Option "Buttons" "5"</nowiki></code> to <code><nowiki>Option "Buttons" "7"</nowiki></code> (see "xorg.conf (X11 configuration file)" section below for an example). You may also have to change the `ZAxisMapping` option from `"4 5"` to `"6 7"`. Be prepared to experiment to discover what works best on your system.
== Mapping More Buttons ==
== Mapping More Buttons ==
The key to being able to program mouse buttons beyond the seven already discussed is to install imwheel (from the [[UbuntuHelp:Universe]] repository). Imwheel will enable you to define application-specific actions to your additional mouse buttons.
The key to being able to program mouse buttons beyond the seven already discussed is to install imwheel (from the [[UbuntuHelp:Universe]] repository). Imwheel will enable you to define application-specific actions to your additional mouse buttons.
 
# Download and install imwheel using Synaptic, Adept, or apt-get
* Download and install imwheel using Synaptic, Adept, or apt-get
# Modify your `/etc/X11/xorg.conf` (or `XF86Config-4`) file to indicate the number of buttons on your mouse
* Modify your `/etc/X11/xorg.conf` (or `XF86Config-4`) file to indicate the number of buttons on your mouse
# Modify your `/etc/X11/imwheel/imwheelrc` or `~/.imwheelrc` file to tell imwheel what to do with a mouse click when it happens in a particular application. See the Wikis referenced below for details on what you can do with your imwheelrc or .imwheelrc file.
* Modify your `/etc/X11/imwheel/imwheelrc` or `~/.imwheelrc` file to tell imwheel what to do with a mouse click when it happens in a particular application. See the Wikis referenced below for details on what you can do with your imwheelrc or .imwheelrc file.
'''NOTE:''' You can use modifications to the `~/.imwheelrc` to limit imwheel behavior to specific users on your system.
'''NOTE:''' You can use modifications to the `~/.imwheelrc` to limit imwheel behavior to specific users on your system.
*#4 Finally, if desired, tell X11 to run imwheel whenever X11 is started (modifying `/etc/X11/Xsession.d/60imwheel_start-imwheel` and changing `IMWHEEL_START=0` to `=1` in `/etc/X11/imwheel/startup.conf`). Alternately, you can start imwheel manually.
1.#4 Finally, if desired, tell X11 to run imwheel whenever X11 is started (modifying `/etc/X11/Xsession.d/60imwheel_start-imwheel` and changing `IMWHEEL_START=0` to `=1` in `/etc/X11/imwheel/startup.conf`). Alternately, you can start imwheel manually.
 
'''NOTE:''' See [[UbuntuHelp:IntellimouseMousemanBackForwardButtons| Set Up an Intellimouse or Mouseman's Back/Forward Buttons]] for an outstanding explanation of how to set up imwheel properly.
'''NOTE:''' See [[UbuntuHelp:IntellimouseMousemanBackForwardButtons| Set Up an Intellimouse or Mouseman's Back/Forward Buttons]] for an outstanding explanation of how to set up imwheel properly.
=== Before You Proceed ===
=== Before You Proceed ===
Before any further editing to `xorg.conf` or `.imwheelrc`, it might be helpful to check your mouse button mappings.
Before any further editing to `xorg.conf` or `.imwheelrc`, it might be helpful to check your mouse button mappings.
Run `imwheel -c` from a terminal window for imwheel's graphical UI. Pressing the Grab``Wheel``Action button and then one of your mouse's buttons should cause imwheel to show the button's default mapping. In practice, this seemed somewhat inconsistent, but results may differ depending on your particular mouse.
Run `imwheel -c` from a terminal window for imwheel's graphical UI. Pressing the Grab``Wheel``Action button and then one of your mouse's buttons should cause imwheel to show the button's default mapping. In practice, this seemed somewhat inconsistent, but results may differ depending on your particular mouse.
The information you glean from this test could prove helpful if your mouse doesn't have traditional button mappings. If, for example, your side mouse buttons map to the standard left and right (1 and 2) positions, and you wanted these side buttons to control Firefox's Back and Forward buttons, you would use the following `.imwheelrc` entry for Firefox.
The information you glean from this test could prove helpful if your mouse doesn't have traditional button mappings. If, for example, your side mouse buttons map to the standard left and right (1 and 2) positions, and you wanted these side buttons to control Firefox's Back and Forward buttons, you would use the following `.imwheelrc` entry for Firefox.
<pre><nowiki>
<pre><nowiki>
第44行: 第25行:
None,Right,Alt_L|Right
None,Right,Alt_L|Right
</nowiki></pre>
</nowiki></pre>
== Examples ==
== Examples ==
Frequently, the best way to learn is to look at what works for other people. Here are some examples of working `xorg.conf` and `imwheelrc` files. Compare these to your own to help you troubleshoot and test out new configurations.
Frequently, the best way to learn is to look at what works for other people. Here are some examples of working `xorg.conf` and `imwheelrc` files. Compare these to your own to help you troubleshoot and test out new configurations.
=== xorg.conf (X11 configuration file) ===
=== xorg.conf (X11 configuration file) ===
==== Example 1 ====
==== Example 1 ====
This is what the relevant portion of my `xorg.conf` file looks like:
This is what the relevant portion of my `xorg.conf` file looks like:
第65行: 第42行:
EndSection
EndSection
</nowiki></pre>
</nowiki></pre>
'''NOTE:''' Using xmodmap to remap mouse buttons can result in the error "xmodmap:  commandline:1:  bad number of buttons, must have 11 instead of 7". If you want to remap the buttons on your mouse, make the following (or similar) modification to your `xorg.conf` file:
'''NOTE:''' Using xmodmap to remap mouse buttons can result in the error "xmodmap:  commandline:1:  bad number of buttons, must have 11 instead of 7". If you want to remap the buttons on your mouse, make the following (or similar) modification to your `xorg.conf` file:
<pre><nowiki>
<pre><nowiki>
第72行: 第48行:
Option          "ButtonMapping"        "1 2 3 6 7"
Option          "ButtonMapping"        "1 2 3 6 7"
</nowiki></pre>
</nowiki></pre>
==== Example 2 ====
==== Example 2 ====
Here is another example from a Logitech 510 mouse:
Here is another example from a Logitech 510 mouse:
<pre><nowiki>
<pre><nowiki>
Section "InputDevice"
Section "InputDevice"
第89行: 第63行:
EndSection
EndSection
</nowiki></pre>
</nowiki></pre>
==== Example 3 ====
==== Example 3 ====
Finally, here is the `xorg.conf` from a Wireless Intelli``Mouse Explorer 2.0. This is how I got my mouse working after 20 minutes of fiddling.
Finally, here is the `xorg.conf` from a Wireless Intelli``Mouse Explorer 2.0. This is how I got my mouse working after 20 minutes of fiddling.
<pre><nowiki>
<pre><nowiki>
Section "InputDevice"
Section "InputDevice"
第107行: 第78行:
EndSection
EndSection
</nowiki></pre>
</nowiki></pre>
=== imwheelrc ===
=== imwheelrc ===
Here is an example of what a portion of my `.imwheelrc` looks like:
Here is an example of what a portion of my `.imwheelrc` looks like:
<pre><nowiki>
<pre><nowiki>
第117行: 第86行:
None, Right, Control_L|Page_Down
None, Right, Control_L|Page_Down
</nowiki></pre>
</nowiki></pre>
If you'd like to customize your mouse buttons for additional applications, just add more entries like this to the `imwheelrc` file.
If you'd like to customize your mouse buttons for additional applications, just add more entries like this to the `imwheelrc` file.
== Useful links ==
== Useful links ==
* [http://www.google.com/search?q=configure+x11+mouse+buttons&btnG=Search&hl=en&lr= Google Search "configure x11 mouse buttons"]
* [http://www.google.com/search?q=configure+x11+mouse+buttons&btnG=Search&hl=en&lr= Google Search "configure x11 mouse buttons"]
* [[UbuntuHelp:IntellimouseMousemanBackForwardButtons| Set Up an Intellimouse or Mouseman's Back/Forward Buttons]]
* [[UbuntuHelp:IntellimouseMousemanBackForwardButtons| Set Up an Intellimouse or Mouseman's Back/Forward Buttons]]
* http://subwiki.honeypot.net/cgi-bin/view/Computing/ExtraMouseButtons
* http://subwiki.honeypot.net/cgi-bin/view/Computing/ExtraMouseButtons
* [http://forums.macosxhints.com/showpost.php?p=46998&postcount=57 Configure a three-button mouse to work with X11.app]
* [http://forums.macosxhints.com/showpost.php?p=46998&postcount=57 Configure a three-button mouse to work with X11.app]
* [http://www.lirc.org/html/configure.html Configuring LIRC (Linux Infrared Remote Control)]
* [http://www.lirc.org/html/configure.html Configuring LIRC (Linux Infrared Remote Control)]
第132行: 第97行:
* [http://fedoraforum.org/forum/showthread.php?s=5745dd389c241334b0dc76f0f7b86a16&t=25659 Fedora Forum: Configuring mouse buttons]
* [http://fedoraforum.org/forum/showthread.php?s=5745dd389c241334b0dc76f0f7b86a16&t=25659 Fedora Forum: Configuring mouse buttons]
* [http://docs.hp.com/en/B2355-90122/ch06s04.html HP: Customizing the Mouse and Keyboard]
* [http://docs.hp.com/en/B2355-90122/ch06s04.html HP: Customizing the Mouse and Keyboard]
[[category:CategoryDocumentation]]
[[category:CategoryDocumentation]]


[[category:UbuntuHelp]]
[[category:UbuntuHelp]]

2007年11月30日 (五) 20:13的版本

{{#ifexist: :ManyButtonsMouseHowto/zh | | {{#ifexist: ManyButtonsMouseHowto/zh | | {{#ifeq: {{#titleparts:ManyButtonsMouseHowto|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:ManyButtonsMouseHowto|1|-1|}} | zh | | }}

  1. title Configuring a Multi-Button Mouse

This page describes how to configure Ubuntu to fully utilize a mouse with multiple buttons, wheels, and other controls.

Before You Begin

It's important to note that Ubuntu considers a standard two button, scroll/click-wheel mouse to have five buttons. Each main button (left and right) count as one, the downward click on the wheel counts as another, and the up/down scrolling also count as one each (2+1+2=5).

Beyond the Basics

If you have installed the GNOME environment (default for Ubuntu) you already have the software needed to get the "6th" and "7th" mouse buttons working (forward/backward on most mice)! Open `/etc/X11/xorg.conf` or `/etc/X11/XF86Config-4` for editing. Within the `InputDevice` section for your `Configured Mouse`, change Option "Buttons" "5" to Option "Buttons" "7" (see "xorg.conf (X11 configuration file)" section below for an example). You may also have to change the `ZAxisMapping` option from `"4 5"` to `"6 7"`. Be prepared to experiment to discover what works best on your system.

Mapping More Buttons

The key to being able to program mouse buttons beyond the seven already discussed is to install imwheel (from the UbuntuHelp:Universe repository). Imwheel will enable you to define application-specific actions to your additional mouse buttons.

  1. Download and install imwheel using Synaptic, Adept, or apt-get
  2. Modify your `/etc/X11/xorg.conf` (or `XF86Config-4`) file to indicate the number of buttons on your mouse
  3. Modify your `/etc/X11/imwheel/imwheelrc` or `~/.imwheelrc` file to tell imwheel what to do with a mouse click when it happens in a particular application. See the Wikis referenced below for details on what you can do with your imwheelrc or .imwheelrc file.

NOTE: You can use modifications to the `~/.imwheelrc` to limit imwheel behavior to specific users on your system. 1.#4 Finally, if desired, tell X11 to run imwheel whenever X11 is started (modifying `/etc/X11/Xsession.d/60imwheel_start-imwheel` and changing `IMWHEEL_START=0` to `=1` in `/etc/X11/imwheel/startup.conf`). Alternately, you can start imwheel manually. NOTE: See Set Up an Intellimouse or Mouseman's Back/Forward Buttons for an outstanding explanation of how to set up imwheel properly.

Before You Proceed

Before any further editing to `xorg.conf` or `.imwheelrc`, it might be helpful to check your mouse button mappings. Run `imwheel -c` from a terminal window for imwheel's graphical UI. Pressing the Grab``Wheel``Action button and then one of your mouse's buttons should cause imwheel to show the button's default mapping. In practice, this seemed somewhat inconsistent, but results may differ depending on your particular mouse. The information you glean from this test could prove helpful if your mouse doesn't have traditional button mappings. If, for example, your side mouse buttons map to the standard left and right (1 and 2) positions, and you wanted these side buttons to control Firefox's Back and Forward buttons, you would use the following `.imwheelrc` entry for Firefox.

"^Firefox-bin$"
None,Left,Alt_L|Left
None,Right,Alt_L|Right

Examples

Frequently, the best way to learn is to look at what works for other people. Here are some examples of working `xorg.conf` and `imwheelrc` files. Compare these to your own to help you troubleshoot and test out new configurations.

xorg.conf (X11 configuration file)

Example 1

This is what the relevant portion of my `xorg.conf` file looks like:

Section "InputDevice"
Identifier      "Configured Mouse"
Driver          "mouse"
Option          "CorePointer"
Option          "Device"                "/dev/input/mice"
Option          "Protocol"              "ExplorerPS/2"
Option          "Emulate3Buttons"       "false"
Option          "Buttons"               "7"
Option          "ZAxisMapping"          "6 7"
EndSection

NOTE: Using xmodmap to remap mouse buttons can result in the error "xmodmap: commandline:1: bad number of buttons, must have 11 instead of 7". If you want to remap the buttons on your mouse, make the following (or similar) modification to your `xorg.conf` file:

Option          "Buttons"               "5"
Option          "ZAxisMapping"          "4 5"
Option          "ButtonMapping"         "1 2 3 6 7"

Example 2

Here is another example from a Logitech 510 mouse:

Section "InputDevice"
Identifier  "Configured Mouse"
Driver      "mouse"
Option      "Buttons" "7"
Option      "CorePointer"
Option      "Device" "/dev/input/mice"
Option      "Protocol" "ExplorerPS/2"
Option      "ZAxisMapping" "4 5"
Option      "ButtonMapping" "1 2 3 6 7"
Option      "Resolution" "800"
EndSection

Example 3

Finally, here is the `xorg.conf` from a Wireless Intelli``Mouse Explorer 2.0. This is how I got my mouse working after 20 minutes of fiddling.

Section "InputDevice"
Identifier  "Configured Mouse"
Driver      "mouse"
Option      "CorePointer"
Option      "Device"                "/dev/input/mice"
Option      "Protocol"              "ExplorerPS/2"
Option      "Emulate3Buttons"       "false"
Option      "Buttons"               "7"
Option      "ZAxisMapping"          "6 7"
Option      "ButtonMapping"         "1 2 3 4 5 6 7"
EndSection

imwheelrc

Here is an example of what a portion of my `.imwheelrc` looks like:

"^Firefox-bin$"
# Flip between browser tabs
None, Left, Control_L|Page_Up
None, Right, Control_L|Page_Down

If you'd like to customize your mouse buttons for additional applications, just add more entries like this to the `imwheelrc` file.

Useful links