Chinaunix首页 | 论坛 | 博客
  • 博客访问: 236859
  • 博文数量: 36
  • 博客积分: 2025
  • 博客等级: 大尉
  • 技术积分: 370
  • 用 户 组: 普通用户
  • 注册时间: 2007-03-22 20:55
文章分类

全部博文(36)

文章存档

2008年(4)

2007年(32)

我的朋友

分类: LINUX

2007-03-22 21:56:58

笔记本的鼠标触摸板我基本上很少用,比起外接鼠标还是没那么方便灵活,何况写程序的时候基本上很少用鼠标,但是笔记本的触摸板却在写程序的时候经常搞得鼠标指针胡乱飘移,非常影响键盘输入的准确性。

在linux下控制触摸板必须得使用2.6.x内核,大致有几件事要做:正确配置内核、安装synaptics驱动、正确配置xorg.conf。

1、配置内核



Linux Kernel Configuration: Enable synaptics support
Device Drivers --->
   Input Device Support --->
<*> Event Interface
[*] Mouse --->
<*> PS/2 mouse

2、安装synaptics,在gentoo下直接emerge synaptics即可。

3、配置xorg.conf,首先看看你的输入设备信息,我机器上的输出信息如下:

/home/debianl $ cat /proc/bus/input/devices
I: Bus=0011 Vendor=0001 Product=0001 Version=ab41
N: Name="AT Translated Set 2 keyboard"
P: Phys=isa0060/serio0/input0
S: Sysfs=/class/input/input0
H: Handlers=kbd event0
B: EV=120013
B: KEY=4 2000000 3802078 f840d001 feffffdf ffefffff ffffffff fffffffe
B: MSC=10
B: LED=7

I: Bus=0011 Vendor=0002 Product=0007 Version=0000
N: Name="SynPS/2 Synaptics TouchPad"
P: Phys=isa0060/serio4/input0
S: Sysfs=/class/input/input1
H: Handlers=mouse0 event1
B: EV=b
B: KEY=6420 0 70000 0 0 0 0 0 0 0 0
B: ABS=11000003

I: Bus=0003 Vendor=046d Product=c016 Version=0340
N: Name="Logitech Optical USB Mouse"
P: Phys=usb-0000:00:1d.1-1/input0
S: Sysfs=/class/input/input2
H: Handlers=mouse1 event2
B: EV=7
B: KEY=70000 0 0 0 0 0 0 0 0
B: REL=103

可以看出来触摸板设备文件应为mouse0,然后配置xorg.conf,加入TouchPad的Section内容,并在ServerLayout中加入InputDevice "TouchPad" "SendCoreEvents",以下是我的xorg.conf配置:

Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "TouchPad" "SendCoreEvents"
EndSection

Section "Files"
RgbPath "/usr/share/X11/rgb"
ModulePath "/usr/lib/xorg/modules"
FontPath "/data/fonts/"
FontPath "/usr/share/fonts/misc/"
FontPath "/usr/share/fonts/TTF/"
FontPath "/usr/share/fonts/OTF"
FontPath "/usr/share/fonts/Type1/"
FontPath "/usr/share/fonts/CID/"
FontPath "/usr/share/fonts/100dpi/"
FontPath "/usr/share/fonts/75dpi/"
EndSection

Section "Module"
Load "glx"
Load "extmod"
Load "xtrap"
Load "record"
Load "dbe"
Load "dri"
Load "freetype"
Load "type1"
EndSection

Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
EndSection

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/input/mice"
Option "ZAxisMapping" "4 5 6 7"
EndSection

Section "InputDevice"
Identifier "TouchPad"
Driver "synaptics"
Option "Device" "/dev/input/mouse0"
Option "Protocol" "auto"
Option "SHMConfig" "on"
EndSection

Section "Monitor"
Identifier "Monitor0"
VendorName "Monitor Vendor"
ModelName "Monitor Model"
EndSection

Section "Device"
Identifier "Card0"
Driver "nvidia"
VendorName "nVidia Corporation"
BoardName "Unknown Board"
BusID "PCI:1:0:0"
Option "Accel" "True"
Option "RenderAccel" "True"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
Option "AddARGBGLXVisuals" "true"
SubSection "Display"
Viewport 0 0
Depth 1
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 4
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 8
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 15
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 16
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 24
EndSubSection
EndSection

Section "Extensions"
Option "Composite" "enable"
EndSection

现在你应该就可以使用synclient来配置各项参数了,也可以禁用触摸板,如果你用gnome的话可以安装一个gsynaptics,图形化的配置界面更易用点。
阅读(2055) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~