LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 14201|回复: 19

驱动笔记本的指点杆 TrackPoint Stick 和触摸板 TouchPad

[复制链接]
发表于 2005-3-12 23:37:49 | 显示全部楼层 |阅读模式
越来越多的 Linux fans 开始使用笔记本作为自己的移动办公平台,如何驱动好本本自带的鼠标设备,会给您的使用带来方便,特将我的一些使用经验写下来,供大家参考。

测试平台:
IBM ThinkPad R50 : UltraNav devices: TrackPoint + TouchPad
IBM ThinkPad A30 : UltraNav device: TrackPoint
其它平台等待大家测试。

本本自带的鼠标设备不外乎指点杆 TrackPoint 和触摸板 TouchPad,我相信经常使用 Windows 的朋友对小红帽(TrackPoint)会情有独钟,它的灵活性不亚于外接鼠标,特别是中键 + 指点杆上下左右滚动网页的功能更令人爱不释手(IBM Thinkpad 适用)。废话少说,下面我们让鼠标在 linux 下复活。

准备工作:
1.
# apt-get install gpm

# vi /etc/gpm.conf
device=/dev/psaux
responsiveness=
repeat_type=raw
type=ps2
append=''
sample_rate=

# /etc/init.d/gpm restart

# ps ax |grep gpmtp-r50:~# ps ax |grep gpm
5691 ?        Ss     0:00 /usr/sbin/gpm -m /dev/psaux -t ps2 -Rraw
6091 pts/1    S+     0:00 grep gpm

有关 gpm 我不再介绍,此时在 console  下你应该能使用鼠标了(白色光标)。

2.
# apt-get install xfree86-driver-synaptics
它是用于 XFree86 server 上的触摸板驱动,具体是否支持您的机型,请查看手册。

3.
修改 /etc/X11/XF86config-4
# cp /etc/X11/XF86Config-4 /etc/X11/XF86Config-4.custom
# md5sum /etc/X11/XF86Config-4 >/var/lib/xfree86/XF86Config-4.md5sum
# dpkg-reconfigure xserver-xfree86

对于 ThinkPad R50 ( R5x , T4x 系列适用 ),修改如下:

  1. Section "Module"
  2.         ......
  3.          Load    "synaptics"     # TouchPad driver
  4. Endsection

  5. Section "InputDevice"
  6.         Identifier      "Thinkpad Keyboard"
  7.         Driver          "keyboard"
  8.         Option          "CoreKeyboard"
  9.         Option          "XkbRules"      "xfree86"
  10.         Option          "XkbModel"      "pc104"
  11.         Option          "XkbLayout"     "us"
  12. EndSection

  13. # 把指点杆 TrackPoint 虚拟成一只滚轮鼠
  14. Section "InputDevice"
  15.         Identifier      "Thinkpad Trackpoint"
  16.         Driver          "mouse"
  17.         Option          "CorePointer"
  18.         Option          "Device"                "/dev/gpmdata"
  19.         Option          "Protocol"              "PS/2"
  20.         Option          "Emulate3Buttons"       "on"
  21.         Option          "Emulate3Timout"        "50"
  22.         Option          "EmulateWheel"          "on"
  23.         Option          "EmulateWheelButton"    "2"
  24. EndSection

  25. # 触摸板输入设备
  26. Section "InputDevice"
  27.         Identifier      "Thinkpad Touchpad"
  28.         Driver          "synaptics"
  29.         Option          "SendCoreEvents"        "true"
  30.         Option          "Device"                "/dev/input/event3"
  31. EndSection

  32. # 外接 USB 鼠标设备
  33. Section "InputDevice"
  34.         Identifier      "USB Optical Mouse"
  35.         Driver          "mouse"
  36.         Option          "SendCoreEvents"        "true"
  37.         Option          "Device"                "/dev/input/mice"
  38.         Option          "Protocol"              "ImPS/2"
  39.         Option          "Emulate3Buttons"       "true"
  40.         Option          "ZAxisMapping"          "4 5"
  41. EndSection
  42. ......

  43. Section "ServerLayout"
  44.         Identifier      "Default Layout"
  45.         Screen          "Default Screen"
  46.         InputDevice     "Thinkpad Keyboard"
  47.         InputDevice     "Thinkpad Trackpoint"
  48.         InputDevice     "Thinkpad Touchpad"
  49.         InputDevice     "USB Optical Mouse"
  50. EndSection
复制代码


对于 ThinkPad A30,无触摸板,只有指点杆,修改如下:

  1. Section "Module"
  2.         ......
  3.          Load    "synaptics"     # TouchPad driver
  4. EndSection

  5. Section "InputDevice"
  6.         Identifier      "Thinkpad Keyboard"
  7.         Driver          "keyboard"
  8.         Option          "CoreKeyboard"
  9.         Option          "XkbRules"      "xfree86"
  10.         Option          "XkbModel"      "pc104"
  11.         Option          "XkbLayout"     "us"
  12. EndSection

  13. # 把指点杆 TrackPoint 虚拟成一只滚轮鼠
  14. Section "InputDevice"
  15.         Identifier      "Thinkpad Trackpoint"
  16.         Driver          "mouse"
  17.         Option          "CorePointer"
  18.         Option          "Device"                "/dev/gpmdata"
  19.         Option          "Protocol"              "PS/2"
  20.         Option          "Emulate3Buttons"       "on"
  21.         Option          "Emulate3Timout"        "50"
  22.         Option          "EmulateWheel"          "on"
  23.         Option          "EmulateWheelButton"    "2"
  24. EndSection

  25. # 外接 USB 鼠标设备
  26. Section "InputDevice"
  27.         Identifier      "USB Optical Mouse"
  28.         Driver          "mouse"
  29.         Option          "SendCoreEvents"        "true"
  30.         Option          "Device"                "/dev/input/mice"
  31.         Option          "Protocol"              "ImPS/2"
  32.         Option          "Emulate3Buttons"       "true"
  33.         Option          "ZAxisMapping"          "4 5"
  34. EndSection
  35. ......

  36. Section "ServerLayout"
  37.         Identifier      "Default Layout"
  38.         Screen          "Default Screen"
  39.         InputDevice     "Thinkpad Keyboard"
  40.         InputDevice     "Thinkpad Trackpoint"
  41.         InputDevice     "USB Optical Mouse"
  42. EndSection
复制代码


注意:gpm 服务务必开启。
缺陷:TrackPoint + middle button 不能左右滚动网页,只是简单模拟了上下滚动。
发表于 2005-3-13 08:00:30 | 显示全部楼层
我的怎么还是不行?我的是触摸板。以下是我的配置文件,请帮忙修改一下,谢谢!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复 支持 反对

使用道具 举报

发表于 2005-3-13 20:45:52 | 显示全部楼层
大侠帮忙帮到底阿?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-3-13 22:34:45 | 显示全部楼层
word 文档我看不了
回复 支持 反对

使用道具 举报

发表于 2005-3-14 10:41:06 | 显示全部楼层
你把.doc扩展名去掉就可以了,因为上传的格式不支持。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-3-14 11:17:36 | 显示全部楼层
关于触摸板 TouchPad 驱动 synaptics 的详细介绍。

作者主页:
http://web.telia.com/~u89404340/touchpad/index.html

synaptics 在 debian 中对应的包裹叫做 xfree86-driver-synaptics,功能设计的很强大。
1. 内核支持:
Device Drivers --> Input Device Support --> Mice ->  PS/2 mouse

2. xfree86 驱动支持
# apt-get install xfree86-driver-synaptics
# vi /etc/X11/XF86Config-4
  1.      
  2. Section "InputDevice"
  3.         Identifier      "Thinkpad Touchpad"
  4.         Driver          "synaptics"
  5.         Option          "SendCoreEvents"       "true"
  6.         Option          "Device"                     "/dev/psaux"
  7.         Option          "Protocol"                   "auto-dev"
  8.         Option          "LeftEdge"                  "1700"
  9.         Option          "RightEdge"                "5300"
  10.         Option          "TopEdge"                  "1700"
  11.         Option          "BottomEdge"              "4200"
  12.         Option          "FingerLow"                "25"
  13.         Option          "FingerHigh"               "30"
  14.         Option          "MaxTapTime"            "180"
  15.         Option          "MaxTapMove"            "220"
  16.         Option          "VertScrollDelta"         "100"
  17.         Option          "MinSpeed"                "0.09"
  18.         Option          "MaxSpeed"               "0.18"
  19.         Option          "AccelFactor"             "0.0015"
  20.         [color=red]Option          "SHMConfig"              "on"[/color]
  21. EndSection
复制代码

注意最后一项  "SHMConfig",  如果你想在 X 下直接修改 TouchPad 设置,请打开。

下面介绍几个它的几个图形配置工具:
1) ksynaptics  - A KDE application to configure Synaptics
# apt-get install ksynaptics
打开  KDE 控制中心(Control Center ) -> Peripherals -> Touch Pad
请查看截图

2) qsynaptics - QT 写的
# apt-get install qsynaptics
# qsynaptics
请查看截图

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-3-14 11:22:25 | 显示全部楼层
Post by erniu
你把.doc扩展名去掉就可以了,因为上传的格式不支持。


你把  freetype 和  xtt 去掉一个看看,可能会冲突,配置没多大问题。
还有你把  xf86config.log  最后一段出错位置信息贴一下,不要把全部都贴上来。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-3-14 14:38:04 | 显示全部楼层
接上文,现在来谈谈对指点杆 TrackPoint 的试用经验。
其实我更加喜欢用指点杆,个人感觉比触摸板来的顺手。指点杆实际上就是一只 PS/2 鼠标,只要内核选上 PS/2 驱动应该就能使用了,在第一贴中我已经写了它的一些最基本的配置,为了获了更多的控制,我们还需要其它的软件支持。

在网上搜了一下,有两个常用软件:
1. tp-scroll
参考连接:
主页:http://rsim.cs.uiuc.edu/~sachs/tp-scroll/
补丁版本:http://www.antrix.net/stuff/suse_thinkpad/
主要区别在于,middle button scroll 功能,原版只支持垂直滚动。补丁版本加上了水平滚动。具体介绍请看主页。
tp-scroll 能搭配 synaptics 触摸板驱动一起使用,它是在 suse 上实现的,暂无  debian 版本,因此你需要手动写一个它的起动脚本,我把我参考的脚本写一下,不过未完成,仅供参考,如果你有兴趣,帮忙完善一下:

我使用的是补丁版本:
拷贝编译好的  tp-scroll 可执行文件到 /usr/local/bin/
# mkfifo /dev/imouse
# cat /etc/init.d/tp-scroll

  1. #! /bin/sh
  2. #
  3. ### BEGIN INIT INFO
  4. # Provides:          FOO
  5. # Required-Start:    $syslog $remote_fs
  6. # Required-Stop:     $syslog $remote_fs
  7. # Default-Start:     3 5
  8. # Default-Stop:      0 1 2 6
  9. # Short-Description: tp-scroll providing scrolling with IBM's Trackpoint
  10. # Description:       see README for detailed description
  11. ### END INIT INFO

  12. # Check for missing binaries (stale symlinks should not happen)
  13. TPSCROLL_BIN=/usr/local/bin/tp-scroll
  14. test -x $TPSCROLL_BIN || exit 5

  15. TPSCROLL_ARGS="/usr/bin/nice -n -10 $TPSCROLL_BIN /dev/gpmdata /dev/imouse"
  16. case "$1" in
  17.     start)
  18. echo -n "Starting tp-scroll: "
  19. /sbin/start-stop-daemon --start --background --exec $TPSCROLL_ARGS

  20. case $? in
  21. (0)
  22.     echo ": tp-scroll."
  23.     exit 0
  24.     ;;
  25. (1)
  26.     echo " failed (already running)."
  27.     exit 0
  28.     ;;
  29. (*)
  30.     echo " failed."
  31.     exit 1
  32.     ;;
  33. esac
  34. ;;
  35.     stop)
  36. echo -n "Shutting down tp-scroll: "
  37. /sbin/start-stop-daemon --stop --exec $TPSCROLL_BIN && echo tp-scroll.
  38. ;;
  39.     restart)
  40. $0 stop
  41. $0 start
  42. ;;
  43.     status)
  44. echo -n "Checking for service tp-scroll "
  45. # checkproc $TPSCROLL_BIN
  46. echo To be done
  47. # rc_status -v
  48. ;;
  49.     *)
  50. echo "Usage: $0 {start|stop|status|restart}"
  51. exit 1
  52. ;;
  53. esac
复制代码

# update-rc.d tp-scroll start 20 3 5 . stop 20 0 1 2 6 .
# /etc/init.d/tp-scroll start

# vi /etc/X11/XF86config-4

  1. Section        "InputDevice"
  2.        Identifier      "Thinkpad Trackpoint"
  3.        Driver          "mouse"
  4.        Option          "CorePointer"
  5.        Option         "Device"                "/dev/imouse"
  6.        Option          "Buttons"               "7"
  7.        Option          "InputFashion"          "Mouse"
  8.        Option          "Name"                  "PS/2-Mouse;ExplorerPS/2"
  9.        Option          "Protocol"              "ExplorerPS/2"
  10.        Option          "ZAxisMapping"          "6 7"
  11.        Option          "Emulate3Buttons"       "true"
  12.        Option          "EmulateWheel"          "false"
  13. EndSection
复制代码

# startx

使用中你可能会碰到一个小问题,解决方法:
Doing all this got horizontal and vertical scrolling working for me, but with a surprising 'special effect.' The scrolling actions got swapped - moving the trackpoint top/down caused horizontal scrolling and vice-versa! I wrote to Daniel about this problem and he asked me to modify the tp-scroll-patched.c as follows:

242: y = (-1)*getc(in); /* was x = getc(in); */ 243: x = (-1)*getc(in); /* was y = getc(in); */
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-3-14 14:56:08 | 显示全部楼层
接上文,下面介绍我个人认为比较完美的指点杆驱动 configure-trackpoint, 它是一个内核补丁,需要重新编译内核,不过非常简单。
参考连接:
http://tpctl.sourceforge.net/configure-trackpoint.html
http://tpctl.sourceforge.net/
http://people.clarkson.edu/~evanchsa/
http://tpctl.sourceforge.net/configure-trackpoint.html
它其实是 PS/2 的一些扩展,优点是,不需要在 /etc/X11/XF86config-4 里添加任何东西,而且还有  gnome2  的图形配置界面(见截图),个人使用上感觉和 synaptics 配合的不错。
缺点好象不支持水平滚动。
它是通过修改 /proc/trackpoint/ 下的文件来控制功能的。
$ ls -l /proc/trackpoint/
total 0
-rw-r--r--  1 root root 0 2005-01-22 20:15 backup
-rw-r--r--  1 root root 0 2005-01-22 20:15 drag_hyst
-rw-r--r--  1 root root 0 2005-01-22 20:15 ext_dev
-rw-r--r--  1 root root 0 2005-01-22 20:15 jenks_curv
-rw-r--r--  1 root root 0 2005-01-22 20:15 mb
-rw-r--r--  1 root root 0 2005-01-22 20:15 min_drag
-rw-r--r--  1 root root 0 2005-01-22 20:15 neg_inertia
-rw-r--r--  1 root root 0 2005-01-22 20:15 ptson
-rw-r--r--  1 root root 0 2005-01-22 20:15 scroll
-rw-r--r--  1 root root 0 2005-01-22 20:15 sensitivity
-rw-r--r--  1 root root 0 2005-01-22 20:15 skip_back
-rw-r--r--  1 root root 0 2005-01-22 20:15 speed
-rw-r--r--  1 root root 0 2005-01-22 20:15 thresh
-rw-r--r--  1 root root 0 2005-01-22 20:15 transparent
-rw-r--r--  1 root root 0 2005-01-22 20:15 up_thresh
-rw-r--r--  1 root root 0 2005-01-22 20:15 z_time

具体配置见参考连接。

个人觉得配置触摸板和指点杆是比较繁琐的过程,需要一定耐心和运气,关键是找一种适合你习惯的方案,如果碰到问题,不妨多上网搜索一些相关资料。欢迎用 IBM Thinkpad 的朋友谈谈个人经验。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复 支持 反对

使用道具 举报

发表于 2005-3-14 14:56:54 | 显示全部楼层
现在的 linux支持还是比较好的
我的 T23 装好ubuntu之后直接就可以用 指点干了 另外的硬件也没有问题
哪些快捷键也有程序可以支持的
不过没有touchpad  不知道 ubuntu对它支持如何。
回复 支持 反对

使用道具 举报

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

本版积分规则

快速回复 返回顶部 返回列表