设置Intellimouse和Mouseman鼠标的后退/前进按钮
原文出处:官方WIKI
原文作者:魏表明
授权许可:武部芝
翻译人员:purwind
校对人员:郑登妮
贡献者:齐塔仁
适用版本:
文章状态:等待校正
HOWTO: Setup an Intellimouse or Mouseman's Back/Forward Buttons
怎样:设置一个Intellimouse 或者 Mouseman鼠标的后退/前进按键
attachment:IconsPage/IconControlCenter2.png
Have a Microsoft Intellimouse or a Logitech Mouseman? This will get you going with using the side buttons. If you are using Dapper Drake or greater, scroll past these steps and read near the bottom.
拥有一只微软Intellimouse 或者罗技Mouseman鼠标吗?下面将引导您使用侧边按键。如果您使用Dapper Drake或者更高版本,跳过这些步骤直接阅读靠底部的部分。
Step 1: Editing the config file:
步骤1:编辑配置文件:
Edit your /etc/X11/XF86Config-4 or /etc/X11/xorg.conf file so that the mouse section looks like this:
编辑您的/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
- Note1: The resolution option is optional, that's just for mouse accuracy.
- Note2: even if you're using a Logitech Mouseman with only one thumb button, this will still work.
- 注意1:resolution(分辨率)选项是自定的,控制鼠标的精确度。
- 注意2:即使您用的罗技Mouseman只有一个拇指按键,此亦有效。
Step 2: Installing imwheel:
步骤 2:安装imwheel
Now we need to install imwheel using apt-get:
现在我们需要使用 apt-get 来安装 imwheel :
$ sudo apt-get install imwheel
or by using synaptic to find and install it.
亦可用新立得来查找并安装它。
Step 3: Creating the imwheel config file:
步骤 3:创建imwheel配置文件:
Edit the file /etc/X11/imwheel/imwheelrc using your favorite text editor, in this case, nano:
编辑文件 /etc/X11/imwheel/imwheelrc ,使用你喜爱的文本编辑器即可,本例用的是nano:
$ sudo nano /etc/X11/imwheel/imwheelrc
and put this text in it:
并将此文本置入:
".*" None,Up,Alt_L|Left None,Down,Alt_L|Right
attachment:IconsPage/IconNote.png You are not restricted to keyboard keys in your imwheelrc. For instance, you can simulate a normal click by specifying a line like "None, Thumb2, Button1" in your wheelrc. If you add the repeat parameter (i.e. "None, Thumb2, Button1, 2"), you can easily simulate a double click.
- Could someone help clarify this a bit more? Does this mean that I will be able to use back buttons with nautilus/metacity/xgl?
在您的 imwheelrc 里,您并不局限于使用键盘按键。 例如, 通过在您的 wheelrc中指定一句 "None, Thumb2, Button1",您可以模拟一个正常点击 。 如果您添加一个重复参数 (也就是"None, Thumb2, Button1, 2"),您可以轻松的模拟一次双击。
- 有人能帮忙解释的更清楚些吗? 是不是这样就意味着我能在 nautilus/metacity/xgl中使用后退按键了?(译者注:这句是原作者问的。)
Step 4-1: Configuration for GDM, KDM, and XDM:
步骤4-1:针对GDM, KDM, 和 XDM的配置
If you don't use GDM, KDM, or XDM, skip this step (if you log in through a graphical interface, you DO use one of these). If you do, create a file called "57xmodmap" in /etc/X11/Xsession.d/:
如果您不用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"
Save the file and then change the permissions so that it can be executed:
保存文件并修改权限,使其可被执行:
sudo chmod 755 /etc/X11/Xsession.d/57xmodmap
To explain the naming convention, the number at the beginning tells the xsession when to load a process. If you list the contents of /etc/X11/Xsession.d/ you'll notice that the file starting with 60 is the imwheel script. It was automatically created when installed. We need the xmodmap to run before that, so I chose 57. Now log out and log back in to get everything working. You should now be able to use the forward and back buttons (or just the back button, depending on how many buttons your mouse has). Reboot to see the changes.
解释一下命名约定, 开头的数字告诉 xsession 何时加载一个进程。 如果您把 /etc/X11/Xsession.d/ 的内容列出来会注意到以60开始的文件就是imwheel的脚本。它是在安装时自动创建的。我们需要xmodmap在它之前运行,因此我选择57。现在登出再登录,使一切起作用。您应该可以使用前进和后退按键了(或许只是后退按钮,取决于您的鼠标有多少按键)。重启看看改变。
Step 4-2: Editing for startx users:
步骤 4-2:针对startx使用者所作的编辑
If you use GDM, KDM, or XDM, you're already done. If you use text mode login and use startx to enter X, put the following in your /home/username/.xinitrc file, before the line that starts your window manager (which you have to have if you're using an .xinitrc, as far as I can tell):
如果您使用GDM,KDM,或是 XDM那么您不必费心了。如果您使用文本模式登录并使用startx来进入X,那么把下面内容放入您的/home/username/.xinitrc 文件,放在启动您的窗口管理器那一句前面(您要是使用.xinitrc的话,肯定会有的,我不多说了)。
xmodmap -e "pointer = 1 2 3 6 7 4 5" & exec imwheel -k -b "67" &
You may have to make this file. If so, be sure you put in
您可能需要make这个文件。如果这样请确保您已经置入
gnome-session &
or
或者
startkde &
- or whatever command your Window Manager uses at the very end of it. Log out and log back in to see the changes.
This concludes the tutorial. Maybe that expensive mouse wasn't a waste after all!
- 或其他任何您的窗口管理器在最末尾所用的命令。登出再登录看看改变。
指南到此结束。现在那些死贵的鼠标不该是废物了!
Comments
It's much easier to undresatnd when you put it that way!