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

来自Ubuntu中文
跳到导航跳到搜索
Oneleaf留言 | 贡献
无编辑摘要
Wikibot留言 | 贡献
无编辑摘要
 
(未显示2个用户的14个中间版本)
第1行: 第1行:
{{From|https://help.ubuntu.com/community/ManyButtonsMouseHowto}}
{{From|https://help.ubuntu.com/community/ManyButtonsMouseHowto}}
{{Languages|php5}}
{{Languages|UbuntuHelp:ManyButtonsMouseHowto}}
#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)!
== Limitations ==
Note that xorg X Input system is not able to bind a combination of more than one mouse button to a certain action. For example, it is not possible to bind left-clicking while simultaneously scrolling up to a specific action. Only binding of one action to each button is allowed, except when combining them with keyboard modifier keys (Ctrl, Alt, Super,...)
== Remapping buttons ==
Some pointing devices have a strange button mapping, so need some tweaking to match X's perception of things. Such tweaking can be performed at runtime with xinput - find your device in <code><nowiki>xinput list</nowiki></code> and run <code><nowiki>xinput set-button-map <device name> 1 2 3 6 7</nowiki></code>, replacing those numbers with your required button mapping. You might be able to find it by searching for other people with the same hardware, or you might need to play around and see what works.
== 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|Universe]] repository). Imwheel will enable you to define application-specific actions to your additional mouse buttons.
<ol><li>Download and install imwheel using Synaptic, Adept, or apt-get
</li><li>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.</li></ol>


 
'''NOTE:''' You can use modifications to the `~/.imwheelrc` to limit imwheel behavior to specific users on your system.
== Many Buttons Mouse Howto ==
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.
 
=== Before You Proceed ===
This page gives useful informations to configure one of those mice with tons of buttons, wheels and other controls.
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.
If you have installed the GNOME environment you ALREADY have the software needed to get the "4th" and "5th" mice buttons working (forward/backward on most mice)!
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>
 
"^Firefox-bin$"
In /etc/X11/xorg.conf or /etc/X11/XF86Config-4 change <code><nowiki>Option "Buttons" "5"</nowiki></code> to <code><nowiki>Option "Buttons" "7"</nowiki></code> (see "The X11 configuration file" section for an example). You may also have to change the ZAxisMapping option from "4 5" to "6 7" but you'll have to experiment to see what your set-up needs.
None,Left,Alt_L|Left
 
None,Right,Alt_L|Right
=== How to do it ===
 
The key to being able to program your mouse buttons is to install imwheel. Download and install it using Synaptic or apt-get.
 
Then, you will modify your /etc/X11/xorg.conf (or XF86Config-4) file to register that your mouse is more than the "standard" five (5) button mouse.
 
Note: A "standard" 2 (left, right click) + 1 (middle click/scroll) button mouse is actually a five button mouse from X11's perspective! The scroll wheel's up and down action counts as mouse buttons 4 and 5. This means that any mouse with one scroll wheel has two more buttons than you'd expect.
 
Then, you need to modify your /etc/X11/imwheel/imwheelrc or ~/.imwheelrc files 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: If you modify ~/.imwheelrc this means that you can customize the imwheel behavior for each user on the system.
 
Then, if desired, you have to 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.
 
PS See IntellimouseMousemanBackForwardButtons for an outstanding explanation of how to set up imwheel properly.
 
=== The X11 configuration file ===
 
This is what the relevant portion of my xorg.conf file looks like:
<pre><nowiki>
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
</nowiki></pre>
</nowiki></pre>
 
== Examples ==
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:
Frequently, the best way to learn is to look at what works for other people. Here are some examples of working `imwheelrc` files. Compare these to your own to help you troubleshoot and test out new configurations.
<pre><nowiki>
=== imwheelrc ===
        Option          "Buttons"              "5"
Here is an example of what a portion of my `.imwheelrc` looks like:
        Option          "ZAxisMapping"          "4 5"
        Option          "ButtonMapping"        "1 2 3 6 7"
</nowiki></pre>
 
==== Another Example - Logitech 510 ====
<pre><nowiki>
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
</nowiki></pre>
 
=== The .imwheelrc configuration file ===
 
And my .imwheelrc looks like:
<pre><nowiki>
<pre><nowiki>
"^Firefox-bin$"
"^Firefox-bin$"
第74行: 第36行:
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.
(obviously you'd add more applications to this file if you'd like to customize the mouse button behavior in those applications)
== Useful links ==
 
* [http://www.google.com/search?q=configure+x11+mouse+buttons&btnG=Search&hl=en&lr= Google Search "configure x11 mouse buttons"]
=== Displaying Mapped Buttons - Troubleshooting ===
* [http://www.lirc.org/html/configure.html Configuring LIRC (Linux Infrared Remote Control)]
Before editing any files, (xorg.conf or .imwheelrc) you should check your mouse button mappings.
* [http://fedoraforum.org/forum/showthread.php?t=27470 Fedora Forum: Configuring mouse side buttons in FC3]
 
* [http://fedoraforum.org/forum/showthread.php?s=5745dd389c241334b0dc76f0f7b86a16&t=25659 Fedora Forum: Configuring mouse buttons]
Run "imwheel -c" for graphical GUI, then press the GrabWheelAction, then press the mouse button to view its default mapping.
* [http://docs.hp.com/en/B2355-90122/ch06s04.html HP: Customizing the Mouse and Keyboard]
 
----
If for example, your side mouse buttons map to left and right, you would use the following .imwheelrc for firefox.
[[category:CategoryHardware]] [[category:CategoryX]]
 
Example,
Will substitute Left mouse map to Alt_L (left alt) and Left key. (Default Firefox back key combination)
 
and Right to Alt_Left+Right (Default Firefox forward key combination)
 
<pre><nowiki>
"^Firefox-bin$"
None,Left,Alt_L|Left
None,Right,Alt_L|Right
</nowiki></pre>
 
See imwheel for advanced mouse button mappings.
 
=== Useful links ===
 
* http://www.google.com/search?q=configure+x11+mouse+buttons&btnG=Search&hl=en&lr=
* IntellimouseMousemanBackForwardButtons
* http://subwiki.honeypot.net/cgi-bin/view/Computing/ExtraMouseButtons
 
* http://forums.macosxhints.com/showpost.php?p=46998&postcount=57
* http://www.lirc.org/html/configure.html
* http://www.linuxnetmag.com/en/issue5/m5mouse1.html
* http://fedoraforum.org/forum/showthread.php?t=27470
* http://fedoraforum.org/forum/showthread.php?s=5745dd389c241334b0dc76f0f7b86a16&t=25659
* http://docs.hp.com/en/B2355-90122/ch06s04.html
* http://www.linuxforum.com/linux_tutorials/70/1.php
 
 
 
CategoryDocumentation CategoryCleanup


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

2010年5月19日 (三) 23:22的最新版本

{{#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)!

Limitations

Note that xorg X Input system is not able to bind a combination of more than one mouse button to a certain action. For example, it is not possible to bind left-clicking while simultaneously scrolling up to a specific action. Only binding of one action to each button is allowed, except when combining them with keyboard modifier keys (Ctrl, Alt, Super,...)

Remapping buttons

Some pointing devices have a strange button mapping, so need some tweaking to match X's perception of things. Such tweaking can be performed at runtime with xinput - find your device in xinput list and run xinput set-button-map <device name> 1 2 3 6 7, replacing those numbers with your required button mapping. You might be able to find it by searching for other people with the same hardware, or you might need to play around and see what works.

Mapping More Buttons

The key to being able to program mouse buttons beyond the seven already discussed is to install imwheel (from the 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/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.

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 `imwheelrc` files. Compare these to your own to help you troubleshoot and test out new configurations.

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