个人工具

老旧文章/设置微软Intellimouse和罗技Mouseman鼠标按键

来自Ubuntu中文

跳转至: 导航, 搜索

原文出处:官方WIKI

原文作者:魏表明

授权许可:武部芝

翻译人员:purwind

校对人员:郑登妮

贡献者:齐塔仁

适用版本:

文章状态:等待校正



怎样:设置一个Intellimouse 或者 Mouseman鼠标的后退/前进按键

IconsPage?action=AttachFile&do=get&target=IconControlCenter2.png

拥有一只微软Intellimouse 或者罗技Mouseman鼠标吗?下面将引导您使用侧边按键。如果您使用Dapper Drake或者更高版本,跳过这些步骤直接阅读靠底部的部分。


步骤1:编辑配置文件:

编辑您的/etc/X11/XF86Config-4 或者 /etc/X11/xorg.conf 文件使其鼠标部分看起来如下:

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ExplorerPS/2"
Option "Buttons" "7"
Option "ZAxisMapping" "6 7"
Option "Resolution" "100"
EndSection
  • 注意1:resolution(分辨率)选项是自定的,控制鼠标的精确度。
  • 注意2:即使您用的罗技Mouseman只有一个拇指按键,此亦有效。

步骤 2:安装imwheel

现在我们需要使用 apt-get 来安装 imwheel :

$ sudo apt-get install imwheel

or by using synaptic to find and install it.

亦可用新立得来查找并安装它。

步骤 3:创建imwheel配置文件:

编辑文件 /etc/X11/imwheel/imwheelrc ,使用你喜爱的文本编辑器即可,本例用的是nano:

$ sudo nano /etc/X11/imwheel/imwheelrc

并将此文本置入:

".*" 
None,Up,Alt_L|Left
None,Down,Alt_L|Right

IconsPage?action=AttachFile&do=get&target=IconNote.png 在您的 imwheelrc 里,您并不局限于使用键盘按键。 例如, 通过在您的 wheelrc中指定一句 "None, Thumb2, Button1",您可以模拟一个正常点击 。 如果您添加一个重复参数 (也就是"None, Thumb2, Button1, 2"),您可以轻松的模拟一次双击。

  • 有人能帮忙解释的更清楚些吗? 是不是这样就意味着我能在 nautilus/metacity/xgl中使用后退按键了?(译者注:这句是原作者问的。)

步骤4-1:针对GDM, KDM, 和 XDM的配置

如果您不用GDM, KDM, 或者 XDM,请跳过这一步(只要您通过图形界面登录,您肯定用了其中某个)。如果您用,请在 /etc/X11/Xsession.d/ 中创建一个名为"57xmodmap"的文件 :

sudo nano /etc/X11/Xsession.d/57xmodmap
  • and put this code in it:
  • 并此代码置入:
#/bin/bash
xmodmap -e "pointer = 1 2 3 6 7 4 5"

保存文件并修改权限,使其可被执行:

sudo chmod 755 /etc/X11/Xsession.d/57xmodmap

解释一下命名约定, 开头的数字告诉 xsession 何时加载一个进程。 如果您把 /etc/X11/Xsession.d/ 的内容列出来会注意到以60开始的文件就是imwheel的脚本。它是在安装时自动创建的。我们需要xmodmap在它之前运行,因此我选择57。现在登出再登录,使一切起作用。您应该可以使用前进和后退按键了(或许只是后退按钮,取决于您的鼠标有多少按键)。重启看看改变。

步骤 4-2:针对startx使用者所作的编辑

如果您使用GDM,KDM,或是 XDM那么您不必费心了。如果您使用文本模式登录并使用startx来进入X,那么把下面内容放入您的/home/username/.xinitrc 文件,放在启动您的窗口管理器那一句前面(您要是使用.xinitrc的话,肯定会有的,我不多说了)。

xmodmap -e "pointer = 1 2 3 6 7 4 5" &
exec imwheel -k -b "67" &

您可能需要make这个文件。如果这样请确保您已经置入

gnome-session &

或者

startkde &
  • 或其他任何您的窗口管理器在最末尾所用的命令。登出再登录看看改变。

指南到此结束。现在那些死贵的鼠标不该是废物了!

注释(下面有些网友发来的留言,就没有翻译)

在 Ubuntu 6.06 Dapper Drake 中配置应该看上去像这样:

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"          "4 5"
Option          "ButtonMapping"         "1 2 3 6 7"
Option          "Resolution"            "100"
EndSection

xmodmap不要用了,ButtonMapping的效果相同。

在Ubuntu 5.04(Hedgehog)中我有一个6键的罗技Mouseman光电鼠标,我添加/编辑:

Option "Protocol" "ExplorerPS/2"
Option "Buttons" "6"
Option "ZAxisMapping" "4 5"

并且我一点问题也没遇到。根本无需重新映射。

From FelixD Tue Jan 4 01:00:22 +0000 2005 From: Felix D Date: Tue, 04 Jan 2005 01:00:22 +0000 Subject: Almost worked Message-ID: <[email protected]https://www.ubuntulinux.org>


hid
mousedev

to /etc/modules Then I rebooted. Not sure which of the changes did the trick (maybe I just needed to reboot), but that worked for me.

我照着做不成功,google把我引到这个页面: http://www.linuxcompatible.org/cdetail9768.html

我添加了:

hid
mousedev

到 /etc/modules

然后我重启了。不敢肯定是哪里搞得鬼(可能就是需要重启),反正是起作用了。

From EricD Wed Jan 5 03:55:44 +0000 2005 From: Eric D Date: Wed, 05 Jan 2005 03:55:44 +0000 Subject: imwheel is not always needed Message-ID: <[email protected]https://www.ubuntulinux.org>


  • 如果您要做的只是让后退/前进按钮起作用的话,照着本文或者参阅 ManyButtonsMouseHowto 简单的编辑 X11 配置文件即可。 imwheel 不是必需的,因为许多 GNOME 应用程序已经可以使用第四和第五鼠标按键(X11的配置文件中定义为第六和第七,因为滚轮被算成两个按键(向上和向下动作))。

From EricFrederiksen Tue Mar 1 01:16:54 +0000 2005 From: Eric Frederiksen Date: Tue, 01 Mar 2005 01:16:54 +0000 Subject: Logitech MX1000 in Ubuntu Message-ID: <[email protected]https://www.ubuntulinux.org>


  • I just got my Logitech MX1000 working in Ubuntu. However, in the 57xmodmap file, instead of doing 1 2 3 6 7 4 5, do the obvious 1 2 3 4 5 6 7. If you do it the first way, your back and forward buttons scroll up and down respectively and your wheel and cruise buttons will take you back and forward. I don't have the tilts or programmable button working, but I don't use them. I hope this helps another Logitech fan out there.

From LasseOrsila Fri Mar 4 15:01:43 +0000 2005 From: Lasse Orsila Date: Fri, 04 Mar 2005 15:01:43 +0000 Subject: a hint for other novice users about Option "Protocol" Message-ID: <[email protected]https://www.ubuntulinux.org>


  • I use a Logitech MX310 mouse with both back/forward buttons. This how-to was very usefull and I got my mouse working. However, the 'Step 1: Editing the config file' has a line Option "Protocol" "ExplorerPS?/2" but it you happen to copy-paste it you get the '?' mark along which is a link here. At least for my Ubuntu the xserver doesn't even start with that, instead line without '?' Option "Protocol" "ExplorerPS/2" gives a much more satisfying result.

Adding: "hid mousedev" to /etc/modules seems not to be needed, instead booting was needed or at least restarting the xserver.

From JockeAndersson Wed Mar 23 14:40:16 +0000 2005 From: Jocke Andersson Date: Wed, 23 Mar 2005 14:40:16 +0000 Subject: Option error Message-ID: <[email protected]https://www.ubuntulinux.org>


  • For some reason, my xserver didn't want to start and complained about the Buttons option (Option "Buttons" "7"). I removed that line and it worked as a charm.

From JuergenKreileder Sun Apr 3 22:17:19 +0100 2005 From: Juergen Kreileder Date: Sun, 03 Apr 2005 22:17:19 +0100 Subject: tilt wheel mice Message-ID: <[email protected]https://www.ubuntulinux.org>

I've written two short howtos on getting all buttons and the tilt wheel working on Logitech MX1000 and IntelliMouse Explorer. See http://blog.blackdown.de/2005/04/03/logitech-mx1000-configuration/ and http://blog.blackdown.de/2005/03/01/tilt-wheel-mouse/

From AdamFalkofske Thu Apr 21 05:26:34 +0100 2005 From: Adam Falkofske Date: Thu, 21 Apr 2005 05:26:34 +0100 Subject: Bingo! Message-ID: <[email protected]https://www.ubuntulinux.org>


  • Worked fine, I rebooted after following the first four steps and when I rebooted, it worked great. Rock on!

- I second the person above who said there's NO need to bother with imwheel. I learn this after breaking XWindow with its config! Mine is one of the very first IntelliMice and works fine after simply editing xorg.conf as above - except ZAxisMapping is set at 4/5. NB.

- 5.10 x86 clean install with microsoft intellimouse usb on ps/2 port. Modifying /etc/X11/xorg.conf (and ONLY modifying xorg.conf, i.e. I did not do anything else) as above results in the thumb and rightmost buttons to act as scroll up and scroll down and wheel as back and forward.

Ended up modifying /etc/X11/xorg.conf as follows, again, ONLY modifying xorg.conf, i.e. I did not install imwheel:

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

This yields a functional scroll wheel (scroll up and down as expected) functionning left and right button as conventionnally expected. Thumb and right most buttons act as "back and forward" in firefox. Pressing the scroll wheel (up-down) does not cycle through open windows as in MS Windows. Rather, it acts as the conventionnal paste shortcut as expected. (April 30 2006)


  • 文章来源:官方WIKI
    翻译人员:purewind
    校对人员:
    文章状态:等待校正