Logitech Marble Mouse

来自 Arch Linux 中文维基

本文内容或本节内容已经过期。

原因: 请提供模板的第一个位置参数以概括原因。 (在Talk:Logitech Marble Mouse讨论)

罗技木星轨迹球具有四个按键,且是对称的,因而不论左右手都适合使用。Picture缺点是不具滚轮功能,但可以设定来启用此功能。

安装[编辑 | 编辑源代码]

无缺额外驱动程式。在系统启动或在已开启系统中连接时,即可侦测到罗技木星。罗技木星虽然可以当作一般鼠标来使用,不进行设定,然而你可能想要启用滚轮功能或客制化按键。

基本功能[编辑 | 编辑源代码]

无论何种硬件设定,木星的硬件ID固定的。

当没有额外设定时,按钮会为下列功能:

ID 硬件动作 结果
1 左大按键 左键
2 双击(大按键) 中键 †
3 右大按键 右键
4 “无” -
5 “无” -
6 “无” -
7 “无” -
8 左小按键 上一页
9 右小按键 下一页

Template:Note (繁体中文)

ID 硬件动作 结果
4 球体向下 鼠标向下
5 球体向上 鼠标向上
6 球体向左 鼠标向左
7 球体向右 鼠标向右

Template:Note (繁体中文)

Template:Note (繁体中文) 在“滚轮模式”使用轨迹球时,也可使用一些鼠标手势的功能,例如,在同时按压Ctrl键跟滚动滚轮可以缩放浏览器中的字体。使用轨迹球时,则需同时按压Ctrl与“滚轮模式按压键”来触发功能。

配置[编辑 | 编辑源代码]

你可以参考及尝试这个 简易配置

这个配置含有一些资讯,大部分的Arch使用者使用的现行X server的配置是需要udev热插拔。

Template:Note (繁体中文)

可在Ubuntu 12.04 的Gnome 3环境下使用。

按键与轨迹球[编辑 | 编辑源代码]

簡單配置依照你的喜好修改後,放置在正確位置即可使用。

指定按键[编辑 | 编辑源代码]

借由设定参数,你可以指定功能给不同按键。

按键的值可以修改为1、2、3、8、及9(2是双击两个大按键),但不要调整成4、5、6、或7。

# 此行是不同的按鈕配置
Option "ButtonMapping" "1 2 3 4 5 6 7 8 9"

左手使用需要使用不同的按钮动作。

# 此行是左手使用都的按鈕配置(僅按鍵左右交換)
Option "ButtonMapping" "3 2 1 4 5 6 7 8 9"

对小按钮,不喜欢“原始”配置可以修改按键的值

这一行修改按钮2成“上一页”。参数2(双击大按钮)的值修改9,改成“上一页”。此行也将参数8、9的值都改为2,使两个小按钮都各别修改成“中键”。

# 這是給右手使用者的,修改了三個按鈕
Option "ButtonMapping" "1 9 3 4 5 6 7 2 2"

参数按顺序排列,参数1、2、3、8、9可修改,但轨迹的移动的参数4、5、6、7 不要修改。

双击大按键[编辑 | 编辑源代码]

如前述,参数2是表示两个大按键同时按下。

经试验,在缺少设定的情形下,会产生不可确定的结果, 而非预期的“中键”。然而,若要双击能正确使用,你需要启用“相黏键”功能:

# Emulate3Buttons 係指同時按下按鍵A與D
# 同時按可以模擬「中鍵」或「滾輪鍵」
Option "Emulate3Buttons" "true"

可以使用预设2(滚轮键),请参minimal configuration

在2012五月些文章Gnome 3 and middle click emulation显示,在ubuntu 12.04 Gnome 3的环境下,预设值会变成 “false”而成为“中键”,原因是Gnome在Xorg进行设定(即Gnome的设定覆盖了Xorg的设定),使的模拟被取消了。可由以下令命修正Gnome的行为:

gsettings set org.gnome.settings-daemon.peripherals.mouse middle-button-enabled true

每个使用者仅需下一次令命即可,Gnome会记得这个设定。如果你感兴趣可以参考 launchpad bug

滚轮修正键[编辑 | 编辑源代码]

罗技木星轨迹球的一个严重缺点是没有滚轮或是滚轮环,但可以借由设定“滚轮修正键”来克服这个问题,即按下一个按钮,使得轨迹球的滚动变成滚轮。虽然,预设已有提供滚轮修正键的功能(参 基本功能),但滚动修正键并没有被启用。若要启用,必需设定给不同的按键。

Template:Note (繁体中文)

小按键的原设定是滚动修正键,但同时该小按键的“点”的预设功能是“上一页”,根据多年的使用经验,建议设成“中键”。

撇开关于小按键的抱怨不谈,你可以如下设定“滚轮修正键”

Option "EmulateWheel" "true"
Option "EmulateWheelButton" "8"

# 按鍵8是左邊的小按鍵,適合右手使用者。
# 按鍵9是右邊的小按鍵,適合左手使用者。
# 按鍵2不可設定成「滾輪修正鍵」(又稱做"EmulateWheelButton")

取消水平卷动 你可以取消下行的注解,来取消水平卷动。

# 井字號是註解
# Option "XAxisMapping" "6 7"

虽然我使用两个方向的卷动,但不少人认为单一方向的卷动比较好用。 也许你想尝试取消垂直方向的卷动,但是类似设定是不能取消垂直方向卷动的。

左撇子或右撇子[编辑 | 编辑源代码]

前面章节已经说明如何设定给右手或左手使用的设置。

  • 你可能经常的左右手交替使用
  • 我会在我感到不适前交替

为了左右手交替,我会手动修改配置(加注一些内容)后重启X server。你也可以依你需要自已写一些Script自动化这些步骤。

  • 在Arch Linux上,我建议使用轻量的Openbox做视窗管理。

在其他的桌面环境中,可能有一些简单(或复杂)的小工具做左右手交替的设定。例如,Ubuntu 10.10中,你可以点击一个鼠标控制的面版按钮即进行交替。

System-wide or per-user[编辑 | 编辑源代码]

Template:Note (繁体中文)

If you want the configuration to be system wide, you can add this line to the InputDevice-Section.

Option "ButtonMapping" "1 8 3 2 9"

For a per-user-configuration you need to put this in your ~/.Xmodmap

pointer = 1 8 3 4 5 6 7 2 9 10 11 12 13

or this in your ~/.xinitrc.

xmodmap -e "pointer = 1 8 3 4 5 6 7 2 9 10 11 12 13"

Xorg input hotplugging[编辑 | 编辑源代码]

Template:Note (繁体中文)

Two expositions help you configure a trackball with buttons for click, middle-click, right-click, and scrolling. The first exposition uses Xorg Input Hotplugging; the second does not. Edit them to suit your preferences.

Add this entry to your /etc/X11/xorg.conf:

Section "InputClass"
    Identifier   "Logitech Trackball"
    MatchProduct "Trackball"
    Option       "ButtonMapping"      "1 8 3 4 5 6 7 2 9"
    Option       "EmulateWheel"       "True"
    Option       "EmulateWheelButton" "9"
    Option       "XAxisMapping"       "6 7"
EndSection

To learn more about the used parameters you should read the apropriate section in the evdev man page.

Without Xorg hotplugging[编辑 | 编辑源代码]

Template:Note (繁体中文)

The mouse device entry in /etc/X11/xorg.conf should look like this:

Section "InputDevice"
    Identifier "Mouse0"
    Driver     "mouse"
    Option     "CorePointer"
    Option     "Device"             "/dev/input/mice"
    Option     "Protocol"           "ExplorerPS/2"
    Option     "Buttons"            "9"
    Option     "ZAxisMapping"       "4 5"
    Option     "XAxisMapping"       "6 7"
    Option     "EmulateWheelButton" "9"
    Option     "EmulateWheel"       "true"
EndSection

The "Auto" option for "Protocol" works fine, too. Of course you can use the name you prefer as the Identifier, as long as it is the same you use as InputDevice in the Section "ServerLayout" .

Sample configuration[编辑 | 编辑源代码]

The sample configuration modifies and extends the basic function of the Marble Mouse.

In this example, either of the two small buttons may be clicked to send a wheel-click. Wheel-click means the same as "middle-click" here. In addition, one of the small buttons provides scrolling in conjunction with the trackball. Note that only one small button has the ability for scrolling, although both small buttons are able to wheel-click.

Finally, clicking both large buttons simultaneously sends the browser back event. There is no button to send browser forward.

ID Hardware Action Result (this configuration) New assignment
1 Large button left normal click 1
2 Both large buttons browser back 8
3 Large button right right-click 3
8 Small button left † wheel-click 2
9 Small button right ‡ wheel-click 2

Template:Note (繁体中文)

Configuration file[编辑 | 编辑源代码]

The following lines are appended to /etc/X11/xorg.conf.d/10-evdev.conf

Note: Users of other Linux distributions may find the configuration file in another location. Ubuntu uses /usr/share/X11/xorg.conf.d/10-evdev.conf

This example is set up for right-hand placement with horizontal scrolling disabled.

#       - - - Logitech Marble Mouse Settings - - -
#
#       The Logitech Marble Mouse buttons are mapped [A-D] from left to right: 
#       A (large); B (small) |  C (small); D (large). 
#
#       Preferred options for right-handed usage:
#       A = normal click [1]  
#       B = middle-click [2] 
#       C = middle-click [2] 
#       D = right-click [3]
#       Hold button B while rolling trackball to emulate wheel-scrolling. 
#
#       Preferred options for left-handed usage:
#       A = right-click [3]  
#       B = middle-click [2] 
#       C = middle-click [2]
#       D = normal click [1]
#       Hold button C while rolling trackball to emulate wheel-scrolling.
#       Pressing both large buttons simultaneously (b) produces a "back" action.

Section "InputClass"
        Identifier  "Marble Mouse"
        MatchProduct "Logitech USB Trackball"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"

#       Physical button #s:     A b D - - - - B C    
#       Option "ButtonMapping" "1 8 3 4 5 6 7 2 2"   right-hand placement
#       Option "ButtonMapping" "3 8 1 4 5 6 7 2 2"   left-hand placement
#       b = A & D 
        Option "ButtonMapping" "1 8 3 4 5 6 7 2 2"

#       EmulateWheel: Use Marble Mouse trackball as mouse wheel 
#       Factory Default: 8; Use 9 for right side small button
        Option "EmulateWheel" "true"
        Option "EmulateWheelButton" "8"

#       EmulateWheelInertia: How far (in pixels) the pointer must move to
#       generate button press/release events in wheel emulation mode.
#       Factory Default: 50
        Option "EmulateWheelInertia" "10"

#       Axis Mapping: Enable vertical [ZAxis] and horizontal [XAxis] scrolling
        Option "ZAxisMapping" "4 5"
#       Option "XAxisMapping" "6 7"

#       Emulate3Buttons: Required to interpret simultaneous press of two large
#       buttons, A & D, as a seperate command, b.
#       Factory Default: true
        Option "Emulate3Buttons" "true"
EndSection

Restarting X[编辑 | 编辑源代码]

Changes made to xorg configuration files do not take effect until the X session is restarted. To restart the X session, simply log out from your window manager and log back in.

Or, depending on what display manager you use, you can use one of the following commands:

Default Ubuntu (with LightDM) : sudo restart lightdm

Gnome (with GDM) : sudo restart gdm

KDE (with KDM) : sudo restart kdm

Minimal configuration[编辑 | 编辑源代码]

Using evdev[编辑 | 编辑源代码]

At times it can be useful to start with the absolute minimum and build from there. This is one facet of The Arch Way. In this spirit, I decided to see how few lines I might use to create a usable Marble Mouse configuration.

You can omit all configuration lines and the Marble Mouse is still usable for basic pointing and clicking. However, it will not be able to scroll. The "both-large-button" simultaneous click produces indeterminate results — experimentation shows this.

Given that you are satisfied with default button settings and you wish only to enable scrolling and the "both-large-button" click, you need these lines. The following lines are appended to /etc/X11/xorg.conf.d/10-evdev.conf.

Section "InputClass"
        Identifier  "Marble Mouse"
        MatchProduct "Logitech USB Trackball"
        Option "EmulateWheel" "true"
        Option "EmulateWheelButton" "8"
        Option "XAxisMapping" "6 7"
        Option "Emulate3Buttons" "true"
EndSection

Using libinput[编辑 | 编辑源代码]

As of version 3.16 GDM/Gnome uses libinput. For the device to work as described in the above section (note that wheel click emulation is not yet supported by libinput) you need to install xf86-input-libinput and instead append this to /etc/X11/xorg.conf.d/10-libinput.conf.

/etc/X11/xorg.conf.d/10-libinput.conf
Section "InputClass"
        Identifier      "Marble Mouse"
        MatchProduct    "Logitech USB Trackball"
        Driver          "libinput"
        Option          "ScrollMethod" "button"
        Option          "ScrollButton" "8"
EndSection

Additional tweaks[编辑 | 编辑源代码]

Console (gpm)[编辑 | 编辑源代码]

See Console mouse support for details. Within the console you can use gpm with type option set to imps2. Edit /etc/conf.d/gpm such that:

GPM_ARGS="-m /dev/input/mice -t imps2"

This lets you use the large left button for selecting text and the right button to extend the selection. The small left button acts as a middle-click; it pastes the selection.

Chromium browser[编辑 | 编辑源代码]

By default, Chromium treats a middle-click as a paste command. This choice stems from "Linux tradition", not the capricious whim of one developer. Like myself, you may prefer a Windows approach. I want the middle button(s) to initiate automatic scrolling, not pasting:

  • A browser extension AutoScroll allows middle-click to initiate automatic scrolling.
  • This extension is helpful for any Linux user with a wheel mouse, not just Marble Mouse users.
  • A middle-click initiates automatic scrolling when clicked on a blank area of a web page.
  • When you program both small buttons to emit middle-click, either button can initiate automatic scrolling. That is a click function.
  • When you program one of the small buttons to act as scroll modifier (mouse setup), you can manually scroll web pages without fixing the browser. That is a press‑and‑hold function. (I recommend installing AutoScroll even though it is not absolutely necessary for scrolling.)
  • After you assign the scroll modifier to one of the small buttons, the small buttons act a bit differently from one another. The difference is seen when you compare their "press‑and‑hold" behaviors.

Be sure to install AutoScroll; the similarly-named Auto Scroll extension implements a different feature.

This information also applies to the browser called Google Chrome.

Firefox browser[编辑 | 编辑源代码]

Older versions of Firefox map horizontal-scrolling hardware to perform browser back and browser forward navigation.

This makes vertical scrolling using the trackball almost impossible.

The slightest horizontal motion triggers a URL redirection. To fix this:

  • Enter about:config in the location bar
  • Find the internal variable named mousewheel.horizscroll.withnokey.action. Set its value to 0.
  • It may be useful to set mousewheel.horizscroll.withnokey.numlines to 1 as well.

See also[编辑 | 编辑源代码]