Sunday, October 26, 2008

在Debian下关闭触摸板

使用笔记本的朋友肯定都有过这种经历,在X环境下输入文本时由于受触摸板的影响,鼠标不受控制的乱跑,能不能关闭触摸板?或者更进一步能不能动态的 对触摸板进行控制?经过一段时间的搜索,我得到了肯定的答案。现将过程记录下来,以作备忘之用。如果能对你有所帮助,我会感到更加高兴。
我使用的笔记本是HP Pavilion ze2000,操作系统是Debian Sarge3.1 rc2,自编译内核版本是2.6.18.2,使用的X环境是Gnome 2.8.3,经过以下六个步骤,我就能在Gnome中动态控制触摸板,感觉不错。:)
1. 检测系统是否支持Touchpad
$dmesg | grep Synaptic
Synaptics Touchpad, model: 1, fw: 5.10, id: 0x258eb1, caps: 0xa04713/0x0
input: SynPS/2 Synaptics TouchPad as /class/input/input1

2. 确认Touchpad设备
$cat /proc/bus/input/devices
......
I: Bus=0011 Vendor=0002 Product=0007 Version=0000
N: Name="SynPS/2 Synaptics TouchPad"
P: Phys=isa0060/serio1/input0
S: Sysfs=/class/input/input1
H: Handlers=mouse0 ts0 event1
B: EV=b
B: KEY=6420 0 70000 0 0 0 0 0 0 0 0
B: ABS=11000003
......

3. 安装Synaptics Touchpad Driver
#apt-get install xfree86-driver-synaptics

4. 修改/etc/X11/XF86Config-4
......
Section "Module"
......
Load "synaptics"
EndSection
......
Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "AlwaysCore"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "Emulate3Buttons" "true"
Option "ZAxisMapping" "4 5"
EndSection
Section "InputDevice"
Identifier "Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/input/mouse0"
Option "Protocol" "auto-dev"
Option "SHMConfig" "on"
#默认关闭Touchpad
Option "TouchpadOff" "1"
EndSection
......
Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse" "CorePointer"
InputDevice "Touchpad"
EndSection
......

5. 修改启动模块配置文件/etc/modules,确定包含以下两个模块
......
psmouse
evdev

6. 重启X
$synclient touchpadoff=0 #可以重新打开Touchpad
$synclient touchpadoff=1 #可以重新关闭Touchpad

No comments: