找回密码
 注册
快捷导航
查看: 10973|回复: 4

你的小黑中键滚轮在Linux 中好用吗?看这里

[复制链接] |自动提醒
阅读字号:

100

回帖

0

积分

103

资产值

入门会员 Rank: 1

注册时间
2006-10-9
发表于 2008-11-18 08:45:11| 字数 6,221| - 中国–广东–汕头 电信 | 显示全部楼层 |阅读模式
自从用了小黑,就没怎么用鼠标了,一直用小红点,习惯了在WIN中使用小黑中键滚轮,特别是上网看网页,用了Fedora 9后,就不能用了,找了很长时间,功夫不负有心人,有高人啊,参考他的方法,我用的X32,成功,转贴出来,希望对大家有帮助。以下转自:http://www.linux-wiki.cn/index.p ... E%E5%8A%9F%E8%83%BD

配置Trackpoint的中键滚轮功能

本文参考了thinkwiki.org中的相关文章,主要是做了翻译,并添加了Fedora Core Linux的解决方案。如果使用其它发行版,只要用xserver-xorg,都可以按本文设置。

Trackpoint指的是Thinkpad笔记本上的指点杆(又常被称为红点)。
系统要求
2.6.11以前版本的内核

此段未经测试

2.6.11以前版本的内核中滚动功能可以直接像Windows里一样被驱动。在终端中输入:

# echo -n 1 > /proc/trackpoint/scroll

启用滚动,而用

# echo -n 0 > /proc/trackpoint/scroll

禁用滚动。
2.6.11以后版本的内核

2.6.11以后的内核去掉了原来的相关配置信息,所以只能在X Server中模拟这一功能。

目前实现这一功能需要 "EmulateWheelTimeout" 的支持,但它在Xorg 6.9或7.0的更早版本中不被支持。令人欣慰的是它已经被包含在多数发行版的Xorg版本中,具体情况在http://www.mail-archive.com/devel@xfree86.org/msg03333.html 这里。

Debian/Ubuntu类发行版和Fedora等发行版的设置方法稍有不同,下面分别介绍。
提示:
对于其它发行版,如果在/etc/X11/xorg.conf中有Configured Mouse一项,就参照Debian/Ubuntu的设置方法,如果没有,就参照Fedora Core的设置方法。

为避免出现意外,请先备份你的xorg.conf

# cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak.trackpoint

Debian/Ubuntu等发行版
Debian Stable等版本

安装了此项功能,可以在/etc/X11/xorg.conf中,Configured Mouse部分加入:

      Option "EmulateWheel"          "on"
      Option "EmulateWheelButton"    "2"
      Option "EmulateWheelTimeOut" "200"
      Option "YAxisMapping" "4 5"
      Option "XAxisMapping" "6 7"

以下的配置在我的电脑(IBM R51,1829)上测试通过

Section "InputDevice"
      Identifier  "Configured Mouse"
      Driver      "mouse"
      Option      "CorePointer"
      Option      "Device"              "/dev/input/mice"
      Option      "Protocol"            "ExplorerPS/2"
      Option      "Emulate3Buttons"     "on"
      Option      "Emulate3TimeOut"     "50"
      Option      "EmulateWheel"        "on"
      Option      "EmulateWheelTimeOut" "200"
      Option      "EmulateWheelButton"  "2"
      Option      "YAxisMapping"        "4 5"
      Option      "XAxisMapping"        "6 7"
      Option      "ZAxisMapping"        "4 5"
EndSection

重启X,滚轮就可以用了。
Debian Sid版本

Emulate3Buutons在新版中不再取on、off值,而要取true,故请InputDevice的Configured Mouse修改如下即可: Section "InputDevice"

   Identifier  "Configured Mouse"
   Driver      "mouse"
   Option      "CorePointer"
   Option      "Device"              "/dev/input/mice"
   Option      "Protocol"            "ExplorerPS/2"
   Option      "Emulate3Buttons"     "true"
   Option      "Emulate3TimeOut"     "50"
   Option      "EmulateWheel"        "on"
   Option      "EmulateWheelTimeOut" "200"
   Option      "EmulateWheelButton"  "2"
   Option      "YAxisMapping"        "4 5"
   Option      "XAxisMapping"        "6 7"
   Option      "ZAxisMapping"        "4 5"

EndSection
Ubuntu 8.10版本

在Ubuntu 8.10中,键盘、鼠标不再由X服务器而是HAL管理,/etc/X11/xorg.conf中原有的配置不再有效(实际上Ubuntu在升级时也会自动注释相关部分)。要在Ubuntu 8.10中启用Trackpoint中键的滚轮功能,需要进行如下操作:(对于Ubuntu 8.10之前的版本请不要使用此方法,依照Debian配置方法即可)

首先,创建文件/etc/hal/fdi/policy/mouse-wheel.fdi,内容为:

<?xml version="1.0" encoding="UTF-8"?>
<match key="info.product" string="TPPS/2 IBM TrackPoint">
<merge key="input.x11_options.EmulateWheel" type="string">true</merge>
<merge key="input.x11_options.EmulateWheelButton" type="string">2</merge>
<merge key="input.x11_options.XAxisMapping" type="string">6 7</merge>
<merge key="input.x11_options.YAxisMapping" type="string">4 5</merge>
<merge key="input.x11_options.ZAxsisMapping" type="string">4 5</merge>
<merge key="input.x11_options.Emulate3Buttons" type="string">true</merge>
</match>

完成更改后,重启hal和gdm服务:

sudo /etc/init.d/hal restart
sudo /etc/init.d/gdm restart

由于对应的新驱动(xserver-xorg-input-evdev)存在一些bug,完成上述配置后可能在一些情况下仍然无法使用滚轮,可以尝试自行编译打过补丁的驱动,步骤如下:

wget http://launchpadlibrarian.net/19254960/preinit.diff
sudo apt-get install build-essential
sudo apt-get build-dep xserver-xorg-input-evdev
apt-get source xserver-xorg-input-evdev
cd xserver-xorg-input-evdev-2.0.99+git20080912
patch -p1 < ../preinit.diff
./autogen --prefix=/usr
make
sudo make install

其它发行版

其它发行版只要把xorg.conf中有关鼠标一项如上设置即可,并注意更改ServerLayout部分(如果有的话)的设备名称。下面以Fedora为例介绍:

Fedora中,/etc/X11/xorg.conf中没有Configured Mouse一项,需要添加:

# ServerFlags一节对Fedora 9来说是必要的[1]
Section "ServerFlags"
       Option  "AutoAddDevices"        "false"
EndSection
Section "InputDevice"
      Identifier  "Configured Mouse"
      Driver      "mouse"
      Option      "CorePointer"
      Option      "Device"              "/dev/input/mice"
      Option      "Protocol"            "ExplorerPS/2"
      Option      "Emulate3Buttons"     "on"
      Option      "Emulate3TimeOut"     "50"
      Option      "EmulateWheel"        "on"
      Option      "EmulateWheelTimeOut" "200"
      Option      "EmulateWheelButton"  "2"
      Option      "YAxisMapping"        "4 5"
      Option      "XAxisMapping"        "6 7"
      Option      "ZAxisMapping"        "4 5"
EndSection

Section "InputDevice"
     Identifier        "Synaptics Touchpad"
     Driver                "synaptics"
     Option                "SendCoreEvents"        "true"
     Option                "Device"                "/dev/psaux"
     Option                "Protocol"                "auto-dev"
     Option                "HorizScrollDelta"        "0"
     Option                "SHMConfig"                        "on"
EndSection

在Section "ServerLayout"中,去掉(如果有的话)

InputDevice    "Synaptics" "CorePointer"

加入:

InputDevice    "Configured Mouse"
InputDevice        "Synaptics Touchpad"

配置完成(至少在我的R51 1829上好使的),重新启动X就可以看到效果。
Firefox中水平滚动的配置

Firefox中垂直滚动是没有问题的,但是当试图水平滚动时发现执行的是前进、后退操作。如果要修正,请在地址栏中输入

about:config

回车。更改下列设置:

mousewheel.horizscroll.withcontrolkey.action = 3;
mousewheel.horizscroll.withcontrolkey.numlines = 1;
mousewheel.horizscroll.withcontrolkey.sysnumlines = true;

mousewheel.horizscroll.withnokey.action = 0;
mousewheel.horizscroll.withnokey.numlines = 1;
mousewheel.horizscroll.withnokey.sysnumlines = true;

mousewheel.horizscroll.withshiftkey.action = 1;
mousewheel.horizscroll.withshiftkey.numlines = 1;
mousewheel.horizscroll.withshiftkey.sysnumlines = true;

你也可以直接做如下更改(仅仅避免了由中键导致的前进、后退功能):

mousewheel.horizscroll.withnokey.action = 0;

Opera中滚动的设置

Opera在水平滚动时也可能发生“前进”、“后退”等操作,修正方法为:

菜单中:工具->首选项->高级->快捷键->鼠标设置->Opera Standard->编辑

在弹出的窗口中:

Application->Button6->删除->Button7->删除

确定后,选中Opera Standard(已修改),一路确定即可。

[ Edited by  rmay on 2008-11-18 11:35 ]
X32 2672AEC 1.6/768/80G5K160/无线

3万

回帖

252

积分

5万

资产值

至尊会员II Rank: 4Rank: 4Rank: 4Rank: 4

注册时间
2006-2-7
铜牌荣誉勋章(注册8年以上会员)
发表于 2008-11-20 11:16:12| 字数 19| - 中国–江苏–泰州 中移铁通 | 显示全部楼层
我也是按此贴解决的 感谢作者 感谢楼主分享
回复 支持 反对

使用道具 举报

3233

回帖

58

积分

1万

资产值

钻石会员 Rank: 3Rank: 3Rank: 3

注册时间
2008-6-24
发表于 2008-11-24 20:16:17| 字数 19| - 中国–广东–广州 电信 | 显示全部楼层
我的X40按此方法也搞定。。。谢谢LZ
两个人在一起需要花费很多福气,亦需要两个人共同经营福气,让它不断地增长不断累积,那才能长久...
回复 支持 反对

使用道具 举报

77

回帖

0

积分

87

资产值

入门会员 Rank: 1

注册时间
2008-4-13
发表于 2008-11-25 23:52:10| 字数 4| - 中国–广东–广州 广州恒汇网络通信有限公司 | 显示全部楼层
ding
回复 支持 反对

使用道具 举报

100

回帖

0

积分

103

资产值

入门会员 Rank: 1

注册时间
2006-10-9
 楼主| 发表于 2008-11-30 12:17:39| 字数 37| - 中国–广东–汕头 电信 | 显示全部楼层
在Fedora10的X11文件夹中没找到xorg.conf文件,如何配置?
X32 2672AEC 1.6/768/80G5K160/无线
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Powered by Discuz! X3.5 © 2001-2023 Comsenz Inc

GMT+8, 2025-5-25 02:32 , Processed in 0.094358 second(s), 32 queries , Gzip On, OPcache On.

手机版|小黑屋|安卓客户端|iOS客户端|Archiver|备用网址1|备用网址2|在线留言|专门网

返回顶部