Touchpad Synaptics 触摸板(中文)http://wiki.archlinux.org/index.php/Touchpad_Synaptics_%E8%A7%A6%E6%91%B8%E6%9D%BF(%E4%B8%AD%E6%96%87)

From ArchWikiJump to: navigation, search

i18n English German Русский 简体中文 Contents []

  • 1 简介
  • 2 安装
  • 3 使用GUI图形程序配置
    • 3.1 Gsynaptics
  • 4 高级设置
    • 4.1 用synclient调整
    • 4.2 环状滚动(Circular scrolling)
    • 4.3 插入鼠标禁用触摸板
  • 5 解决问题
    • 5.1 我的触摸板硬件位置不在/dev/input/mouse0
    • 5.2 在键盘输入停止触摸板点击
    • 5.3 Firefox不认垂直滚动
  • 6 链接

[edit] 简介

synaptics 是一个能驱动绝大多数笔记本触摸板的驱动,本文将指导你根据需要安装和配置这个驱动。

[edit] 安装

你可以通过pacman从extra仓库安装synaptics

# pacman -S synaptics

以root身份编辑/etc/X11/xorg.conf,添加InputDevice "Touchpad" "SendCoreEvents"ServerLayout这一节:

Section "ServerLayout"

InputDevice "USB Mouse" "CorePointer"
InputDevice "Touchpad" "SendCoreEvents"
EndSection

添加 Load "synaptics"Module 这一节, 例如:

Section "Module"

Load "freetype"
Load "record"
Load "synaptics"

EndSection

最后,为触摸板添加一个新的InputDevice章节:

Section "InputDevice"
Identifier "Touchpad"
Driver "synaptics"
Option "Device" "/dev/input/mouse0"
Option "Protocol" "auto-dev"
Option "LeftEdge" "1700"
Option "RightEdge" "5300"
Option "TopEdge" "1700"
Option "BottomEdge" "4200"
Option "FingerLow" "25"
Option "FingerHigh" "30"
Option "MaxTapTime" "180"
Option "MaxTapMove" "220"
Option "VertScrollDelta" "100"
Option "MinSpeed" "0.06"
Option "MaxSpeed" "0.12"
Option "AccelFactor" "0.0010"
Option "SHMConfig" "on"
EndSection

对ALPS触摸板: 如果上面配置没有效果,请尝试下面的配置:

Section "InputDevice"
Identifier "Touchpad"
Driver "synaptics"
Option "Device" "/dev/input/mouse0"
Option "Protocol" "auto-dev"
Option "LeftEdge" "130"
Option "RightEdge" "840"
Option "TopEdge" "130"
Option "BottomEdge" "640"
Option "FingerLow" "7"
Option "FingerHigh" "8"
Option "MaxTapTime" "180"
Option "MaxTapMove" "110"
Option "EmulateMidButtonTime" "75"
Option "VertScrollDelta" "20"
Option "HorizScrollDelta" "20"
Option "MinSpeed" "0.25"
Option "MaxSpeed" "0.50"
Option "AccelFactor" "0.010"
Option "EdgeMotionMinSpeed" "200"
Option "EdgeMotionMaxSpeed" "200"
Option "UpDownScrolling" "1"
Option "CircularScrolling" "1"
Option "CircScrollDelta" "0.1"
Option "CircScrollTrigger" "2"
Option "SHMConfig" "on"
Option "Emulate3Buttons" "on"
EndSection

保存,退出,重启X服务,触摸板应该可以使用了。你可以更详细的配置输入设备(InputDevice),需要更多请看 高级设置。

请注意Xorg将自动加载evdevpsmouse 内核模块,因为synaptics需要他们,因此你可以把这两个模块加入/etc/rc.conf文件里面。

MODULES=( … evdev psmouse … )[edit] 使用GUI图形程序配置[edit] Gsynaptics

如果synaptics驱动已经安装,gnome用户可以安装使用gsynaptics:

# pacman -S gsynaptics

想自动保存和加载gsynaptics配置,在自启动程序里面加入gsnynaptics-init:System -> Preferences -> Sessions

注意: 如果不是gnome用户也可以向.xinitrc或者.xsession脚本里面加入gsnynaptics-init

[edit] 高级设置

synaptics 驱动提供许多可以自由定制的选项,下面的列表描述了这些选项,可以加入xorg配置文件中。

Identifier is the name of this input device you've specified in the server layout section above.

Device defines where your synaptic device is located. See Troubleshooting to find your device handler if it isn't /dev/input/mouse0 for you.

LeftEdge, RightEdge, TopEdge and BottomEdge are integer values which indicate the dimensions of your touchpad as x or y coordinates.

FingerLow and FingerHigh are integer values which indicate the 'pressure value' at which the driver counts a touch (pressure value goes above FingerHigh) or a release (pressure value drops below FingerLow).

MaxTapTime is an integer value that defines the maximum time for detecting a tap (in milliseconds).

MaxTapMove is an integer value which defines the maximum movement of your finger for detecting a tap.

MinSpeed and MaxSpeed are set to determine the minimum and maximum speed factor. An floating point value is expected.

AccelFactor is the acceleration factor as well defined as a floating point value.

SHMConfig is a boolean value (on/off) for activating or deactivating shared memory. This needs to be enabled if you want to monitor or configure your synaptics device with clients as synclient, which will be using in this article.

More options are explained in the synaptics' manpage, accessible with:

man 5 synaptics[edit] 用synclient调整

synclient监视器可以实时显示触摸板上的压力和位置,允许更详细调整默认synaptics的设置。为了让synclient能工作,SHMConfig选项必须是on或者true

你可以用下面命令启动synaptics监视:

$ synclient -m 100

Where -m activates the monitor and the following number specifies the update interval in milliseconds.

这个监视器提供你触摸板现在状态信息,例如,如果你用触摸板移动鼠标,监视器中x和y值就会改变。此外,你可以非常容易知道触摸板LeftEdge-, RightEdge-, BottomEdge-和TopEdge-Options的测量值。

下面是缩写的解释:

time

Time in seconds since the logging was started.

x, y

The x/y coordinates of the finger on the touchpad. The origin is in the upper left corner.

z

The pressure value. It represents the pressure you are using to navigate on your touchpad.

f

Number of fingers currently touching the touchpad.

w

Value that represents the finger width.

l,r,u,d,m,multi

Those values represent the state of the left, right, up, down, middle and multi buttons pressed where zero means not pressed and one means pressed.

gl,gm,gr

For touchpads which have a guest device, this are the associated button states for guest left, guest middle and guest right pressed (1) and not pressed (0).

gdx, gdy

x/y coordinates of the guest device.

如果值一直是0,那么说明你的硬件不支持这个选项。

了解这些,你应该能知道需要的数据了。

[edit] 环状滚动(Circular scrolling)

环状滚动是synaptics提供的一项功能,你可能从iPod上知道了这样的功能。你可以使用画圈来代替或者代替垂直和水平滚动。 你可以向触摸板输入设备这一节中添加如下来启动环状滚动:

Section "InputDevice"

Option "CircularScrolling" "on"
Option "CircScrollTrigger" "0"

EndSection

你可能猜到CircularScrolling控制启用和禁用环状滚动。CircScrollTrigger则可能是如下任意一个值,确定环形滚动启动的边缘。

0 All Edges
1 Top Edge
2 Top Right Corner
3 Right Edge
4 Bottom Right Corner
5 Bottom Edge
6 Bottom Left Corner
7 Left Edge
8 Top Left Corner

如果你同时使用垂直或者水平滚动,那么设置不是0的值比较有帮助。如果你这样做,那么滚动将从你决定的地方开始。

如果想滚动快点,就在触摸板上画小圈,否则就画大圈。

[edit] 插入鼠标禁用触摸板

在udev的帮助下,可以实现自动在外部鼠标插入时禁用触摸板。你需要做的是在udev的规则里面添加:

ACTION=="add", SUBSYSTEM=="input", ID_CLASS="mouse", RUN+="/usr/bin/synclient TouchpadOff=1"
ACTION=="remove", SUBSYSTEM=="input", ID_CLASS="mouse", RUN+="/usr/bin/synclient TouchpadOff=0"

把上面内容保存到/etc/udev/rules.d/01-touchpad.rules,而且确保共享内存(SHMConfig)打开。

[edit] 解决问题[edit] 我的触摸板硬件位置不在/dev/input/mouse0

如果这是问题的原因,你可以使用下面的命令来了解你输入设备的信息。

cat /proc/bus/input/devices

搜索名称为"SynPS/2 Synaptics TouchPad"的章节的输入设备。通过这一节的handlers就可以了解xorg.conf中需要使用的硬件。

Example output:

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 7000f 0

如果Handlers是mouse0和event1,就使用/dev/input/mouse0的位置。

[edit] 在键盘输入停止触摸板点击

这是一个简单的小技巧,你可以使触摸板在键盘输入的时候禁用,步骤很简单。加入如下命令到.xinitrc,在启动窗口管理器命令的前面。

syndaemon -i 2 &

-i 2设置停止时间为2秒。停止时间即在键盘输入之后多少秒后重新启用触摸板

另外,你可以使用-t来不阻止触摸板鼠标移动,仅仅禁止点击或者滚动。

syndaemon -t -i 2 &

和其他命令一样,你可以通过man来了解更多应用:

$ man syndaemon[edit] Firefox不认垂直滚动

尽管这个问题不是由驱动引起,但是仍然需要解决。如果想让firefox不从滚动历史记录,而让它在网页滚动,你可以在about:config里面改变下面两个选项。

mousewheel.horizscroll.withnokey.action = 1
mousewheel.horizscroll.withnokey.sysnumlines = true

(小技巧来自 gentoo wiki.)

转载于:https://blog.51cto.com/axlrose/1289321

Touchpad Synaptics 触摸板(中文) [zt]-编程知识网与50位技术专家面对面20年技术见证,附赠技术全景图