个人工具

“UbuntuHelp:Logitech Marblemouse USB”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
第2行: 第2行:
 
{{Languages|UbuntuHelp:Logitech_Marblemouse_USB}}
 
{{Languages|UbuntuHelp:Logitech_Marblemouse_USB}}
 
== Introduction ==
 
== Introduction ==
The newest version of Xorg used in Intrepid brings changes as to how input devices are detected and set up for use.  Hal now plays a large part in the process, and as such xorg.conf is largely ignored, so any settings you had in xorg.conf will no longer be in use when X starts. You will now need to add files to /etc/hal/fdi/policy with an .fdi extension.
+
Input devices are now configured using Hal, which means most settings in '''xorg.conf''' will be ignored when X starts. Hal's configuration files are stored in '''/etc/hal/fdi/policy''' with a file name extension of '''.fdi'''. After making configuration changes, restart X (or reboot the computer).
== Example mouse-wheel.fdi ==
+
The remainder of this document describes how to configure the Logitech Marble Mouse (USB), shown in the following figure:
Placing this file in /etc/hal/fdi/policy/ will enable scrolling while holding down the small, left mouse button on a Logitech Marble Mouse USB.
+
https://help.ubuntu.com/community/Logitech_Marblemouse_USB?action=AttachFile&do=get&target=logitech-marble-mouse.png%7CLogitech+Marble+Mouse+USB%7Cposition%3D%22left%22
 +
== Horizontal and Vertical Scrolling Example ==
 +
To enable vertical and horizontal scrolling while holding down the small, left mouse button (button #2 in the image) change '''/etc/hal/fdi/policy/mouse-wheel.fdi''' to:
 
<pre><nowiki>
 
<pre><nowiki>
 
<?xml version="1.0" encoding="ISO-8859-1"?>
 
<?xml version="1.0" encoding="ISO-8859-1"?>
第10行: 第12行:
 
   <device>
 
   <device>
 
     <match key="info.product" string="Logitech USB Trackball">
 
     <match key="info.product" string="Logitech USB Trackball">
       <merge key="input.x11_options.ButtonMapping" type="string">1 8 3 2 9</merge>
+
       <merge key="input.x11_options.ButtonMapping" type="string">1 2 3 4 5 6 7 8 9</merge>
 
       <merge key="input.x11_options.EmulateWheel" type="string">true</merge>
 
       <merge key="input.x11_options.EmulateWheel" type="string">true</merge>
 
       <merge key="input.x11_options.EmulateWheelButton" type="string">8</merge>
 
       <merge key="input.x11_options.EmulateWheelButton" type="string">8</merge>
 
       <merge key="input.x11_options.ZAxisMapping" type="string">4 5</merge>
 
       <merge key="input.x11_options.ZAxisMapping" type="string">4 5</merge>
 +
      <merge key="input.x11_options.XAxisMapping" type="string">6 7</merge>
 
       <merge key="input.x11_options.Emulate3Buttons" type="string">true</merge>
 
       <merge key="input.x11_options.Emulate3Buttons" type="string">true</merge>
 
     </match>
 
     </match>
 
   </device>
 
   </device>
 
</deviceinfo>
 
</deviceinfo>
 +
</nowiki></pre>
 +
== Vertical Scrolling Example ==
 +
To enable vertical scrolling while holding down the small, left mouse button (button #2 in the image), change '''/etc/hal/fdi/policy/mouse-wheel.fdi''' to:
 +
<pre><nowiki>
 +
<?xml version="1.0" encoding="ISO-8859-1"?>
 +
<deviceinfo version="0.2">
 +
  <device>
 +
    <match key="info.product" string="Logitech USB Trackball">
 +
      <merge key="input.x11_options.ButtonMapping" type="string">1 8 3 9 2</merge>
 +
      <merge key="input.x11_options.EmulateWheel" type="string">true</merge>
 +
      <merge key="input.x11_options.EmulateWheelButton" type="string">8</merge>
 +
      <merge key="input.x11_options.ZAxisMapping" type="string">4 5</merge>
 +
      <merge key="input.x11_options.Emulate3Buttons" type="string">false</merge>
 +
    </match>
 +
  </device>
 +
</deviceinfo>
 +
</nowiki></pre>
 +
=== Firefox ===
 +
If vertical scrolling does not work in Firefox, ensure the following '''about:config''' values are set (using Firefox):
 +
<pre><nowiki>
 +
mousewheel.horizscroll.withnokey.action user set integer 0
 +
mousewheel.horizscroll.withnokey.sysnumlines user set boelean true
 
</nowiki></pre>
 
</nowiki></pre>
 
== Middle Click ==
 
== Middle Click ==
Currently the button mapping described above is being ignored by HAL.  This is particularly problematic if you want one of the small buttons to serve as middle click.  A simple workaround is to remap what you need via xmodmap.  As an example, let's map the small left button as middle click.  Save this in your .Xmodmap file:
+
Currently the button mapping described above is being ignored by Hal. (As of 9.04 it appears that the button mapping is now applied correctly. Only use one method or the other).  This is particularly problematic if you want one of the small buttons to serve as middle click.  A simple workaround is to remap what you need via xmodmap.  As an example, let's map the small left button as middle click.  Save this in your .Xmodmap file:
 
<pre><nowiki>
 
<pre><nowiki>
 
pointer = 1 8 3 4 5 6 7 2 9
 
pointer = 1 8 3 4 5 6 7 2 9
第31行: 第56行:
 
<pre><nowiki>
 
<pre><nowiki>
 
$ xinput set-button-map "Logitech USB Trackball" 1 8 3 4 5 6 7 2 9
 
$ xinput set-button-map "Logitech USB Trackball" 1 8 3 4 5 6 7 2 9
 +
</nowiki></pre>
 +
xinput may report the trackball as having 32 buttons and some window managers such as fluxbox require you to map all buttons reported for the device even though the buttons do not exist when using xinput.  For fluxbox and similar window mangers the command below would map the trackball for left handed use.  The large button on the right would be left click, the large button on the left would be right click, the small button on the right would function as a middle button, and the small button on the left would function as the scroll.
 +
<pre><nowiki>
 +
$ xinput set-button-map "Logitech USB Trackball" 3 9 1 4 5 6 7 8 2 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
 
</nowiki></pre>
 
</nowiki></pre>
 
If you have a different device and don't know its identifier, you can find it via:
 
If you have a different device and don't know its identifier, you can find it via:

2009年5月12日 (二) 17:46的版本

Introduction

Input devices are now configured using Hal, which means most settings in xorg.conf will be ignored when X starts. Hal's configuration files are stored in /etc/hal/fdi/policy with a file name extension of .fdi. After making configuration changes, restart X (or reboot the computer). The remainder of this document describes how to configure the Logitech Marble Mouse (USB), shown in the following figure: https://help.ubuntu.com/community/Logitech_Marblemouse_USB?action=AttachFile&do=get&target=logitech-marble-mouse.png%7CLogitech+Marble+Mouse+USB%7Cposition%3D%22left%22

Horizontal and Vertical Scrolling Example

To enable vertical and horizontal scrolling while holding down the small, left mouse button (button #2 in the image) change /etc/hal/fdi/policy/mouse-wheel.fdi to:

<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
  <device>
    <match key="info.product" string="Logitech USB Trackball">
      <merge key="input.x11_options.ButtonMapping" type="string">1 2 3 4 5 6 7 8 9</merge>
      <merge key="input.x11_options.EmulateWheel" type="string">true</merge>
      <merge key="input.x11_options.EmulateWheelButton" type="string">8</merge>
      <merge key="input.x11_options.ZAxisMapping" type="string">4 5</merge>
      <merge key="input.x11_options.XAxisMapping" type="string">6 7</merge>
      <merge key="input.x11_options.Emulate3Buttons" type="string">true</merge>
    </match>
  </device>
</deviceinfo>

Vertical Scrolling Example

To enable vertical scrolling while holding down the small, left mouse button (button #2 in the image), change /etc/hal/fdi/policy/mouse-wheel.fdi to:

<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
  <device>
    <match key="info.product" string="Logitech USB Trackball">
      <merge key="input.x11_options.ButtonMapping" type="string">1 8 3 9 2</merge>
      <merge key="input.x11_options.EmulateWheel" type="string">true</merge>
      <merge key="input.x11_options.EmulateWheelButton" type="string">8</merge>
      <merge key="input.x11_options.ZAxisMapping" type="string">4 5</merge>
      <merge key="input.x11_options.Emulate3Buttons" type="string">false</merge>
    </match>
  </device>
</deviceinfo>

Firefox

If vertical scrolling does not work in Firefox, ensure the following about:config values are set (using Firefox):

mousewheel.horizscroll.withnokey.action		user set	integer	0
mousewheel.horizscroll.withnokey.sysnumlines	user set	boelean	true

Middle Click

Currently the button mapping described above is being ignored by Hal. (As of 9.04 it appears that the button mapping is now applied correctly. Only use one method or the other). This is particularly problematic if you want one of the small buttons to serve as middle click. A simple workaround is to remap what you need via xmodmap. As an example, let's map the small left button as middle click. Save this in your .Xmodmap file:

pointer = 1 8 3 4 5 6 7 2 9

Note that all we did was to swap the numbers 2 and 8. If you'd like to use the small right button as middle click, swap 2 and 9 instead. The .Xmodmap file will be loaded next time you log in. To run it manually, run:

$ xmodmap .Xmodmap

Using xmodmap affects all mice you have plugged in, an alternative is to use xinput to remap the buttons just for the device you specify.

$ xinput set-button-map "Logitech USB Trackball" 1 8 3 4 5 6 7 2 9

xinput may report the trackball as having 32 buttons and some window managers such as fluxbox require you to map all buttons reported for the device even though the buttons do not exist when using xinput. For fluxbox and similar window mangers the command below would map the trackball for left handed use. The large button on the right would be left click, the large button on the left would be right click, the small button on the right would function as a middle button, and the small button on the left would function as the scroll.

$ xinput set-button-map "Logitech USB Trackball" 3 9 1 4 5 6 7 8 2 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32

If you have a different device and don't know its identifier, you can find it via:

$ xinput list

External Links

  • [1] - Explanation of how to find your input device using xinput.
  • [2] - Link to launchpad with further explanation of how the new hal policy works.
  • [3] - Link to original thread in intrepid testing forums for the Logitech Marble Mouse USB.