https://wiki.archlinux.org/api.php?action=feedcontributions&user=Yanghuan&feedformat=atomArchWiki - User contributions [en]2024-03-29T07:58:14ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Touchpad_Synaptics_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=67968Touchpad Synaptics (简体中文)2009-05-01T08:53:29Z<p>Yanghuan: /* 通过HAL策略(启用hotplugging) */</p>
<hr />
<div>[[Category:简体中文|CMB]]<br />
[[Category:输入设备|CMB]]<br />
[[Category:HOWTOs (简体中文)|CMB]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Touchpad Synaptics}}<br />
{{i18n_entry|German|Touchpad Synaptics (Deutsch)}}<br />
{{i18n_entry|Русский|Тачпад Synaptics}}<br />
{{i18n_entry|简体中文|触摸板 (简体中文)}}<br />
{{i18n_links_end}}<br />
{{translateme}}<br />
<br />
==简介==<br />
synaptics 是一个能驱动绝大多数笔记本触摸板的驱动,本文将指导你根据需要安装和配置这个驱动。<br />
<br />
==安装==<br />
触摸板驱动如今已打包为''xf86-input-synaptics'',可以从标准的软件包仓库中获取到它:<br />
# pacman -S xf86-input-synaptics<br />
<br />
==配置==<br />
有两种方式可以对触摸板进行配置。你该如何做,这取决于你是否启用[[Xorg input hotplugging]]。<br />
<br />
===通过xorg.conf进行配置 (禁用hotplugging)===<br />
<br />
以root身份编辑''/etc/X11/xorg.conf'',在''ServerLayout''里加入'''InputDevice "Touchpad" "SendCoreEvents"''',如:<br />
Section "ServerLayout"<br />
...<br />
InputDevice "USB Mouse" "CorePointer"<br />
'''''InputDevice "SynapticsTouchpad" "SendCoreEvents"<br />
EndSection<br />
<br />
在''Module''段加入'''Load "synaptics"''',如:<br />
Section "Module"<br />
...<br />
Load "glx"<br />
Load "freetype"<br />
'''''Load "synaptics"'''''<br />
...<br />
EndSection<br />
<br />
最后,为触摸板自身新增一个''InputDevice''段:<br />
Section "InputDevice"<br />
Identifier "SynapticsTouchpad"<br />
Driver "synaptics"<br />
Option "AlwaysCore" "true" # send events to CorePointer<br />
#Option "Device" "/dev/input/mice"<br />
Option "Device" "/dev/psaux"<br />
Option "Protocol" "auto-dev"<br />
Option "SHMConfig" "false" # configurable at runtime? security risk<br />
Option "LeftEdge" "1700" # x coord left<br />
Option "RightEdge" "5300" # x coord right<br />
Option "TopEdge" "1700" # y coord top<br />
Option "BottomEdge" "4200" # y coord bottom<br />
Option "FingerLow" "25" # pressure below this level triggers release<br />
Option "FingerHigh" "30" # pressure above this level triggers touch<br />
Option "MaxTapTime" "180" # max time in ms for detecting tap<br />
'''Option "VertEdgeScroll" "true" # enable vertical scroll zone'''<br />
'''Option "HorizEdgeScroll" "true" # enable horizontal scroll zone'''<br />
Option "CornerCoasting" "true" # enable continuous scroll with finger in corner<br />
Option "CoastingSpeed" "0.30" # corner coasting speed<br />
Option "VertScrollDelta" "100" # edge-to-edge scroll distance of the vertical scroll<br />
Option "HorizScrollDelta" "100" # edge-to-edge scroll distance of the horizontal scroll<br />
Option "MinSpeed" "0.10" # speed factor for low pointer movement<br />
Option "MaxSpeed" "0.60" # maximum speed factor for fast pointer movement<br />
Option "AccelFactor" "0.0020" # acceleration factor for normal pointer movements<br />
Option "VertTwoFingerScroll" "true" # vertical scroll anywhere with two fingers<br />
Option "HorizTwoFingerScroll" "true" # horizontal scroll anywhere with two fingers<br />
EndSection<br />
<br />
'''粗体'''标示的行是很重要的,因为用户必须显式启用触摸板的边缘和底部滚动区域。如果你已经有旧触摸板驱动的一个InputDevice段的配置,那么需要正常使用滚动区域的话就得添加这两行。<br />
<br />
保存、退出然后重启X。 现在触摸板应该可以正常使用滚动区域了。你还可以进一步根据自己需要调整''InputDevice''设置。详情可参见[[#高级设置 | 高级设置]]。<br />
<br />
要注意的是,Xorg会自动加载触摸板所需的'''evdev'''和'''psmouse'''核心模块 ,当然如果需要的话你也可以显式的在/etc/rc.conf文件的MODULES列表里加入它们。<br />
<br />
====ALPS 触摸板====<br />
对于ALPS触摸板,如果上述配置仍然不能正常工作,可以尝试使用以下配置:<br />
Section "InputDevice"<br />
Identifier "Touchpad"<br />
Driver "synaptics"<br />
Option "Device" "/dev/input/mouse0"<br />
Option "Protocol" "auto-dev"<br />
Option "LeftEdge" "130"<br />
Option "RightEdge" "840"<br />
Option "TopEdge" "130"<br />
Option "BottomEdge" "640"<br />
Option "FingerLow" "7"<br />
Option "FingerHigh" "8"<br />
Option "MaxTapTime" "180"<br />
Option "MaxTapMove" "110"<br />
Option "EmulateMidButtonTime" "75"<br />
Option "VertScrollDelta" "20"<br />
Option "HorizScrollDelta" "20"<br />
Option "MinSpeed" "0.25"<br />
Option "MaxSpeed" "0.50"<br />
Option "AccelFactor" "0.010"<br />
Option "EdgeMotionMinSpeed" "200"<br />
Option "EdgeMotionMaxSpeed" "200"<br />
Option "UpDownScrolling" "1"<br />
Option "CircularScrolling" "1"<br />
Option "CircScrollDelta" "0.1"<br />
Option "CircScrollTrigger" "2"<br />
Option "SHMConfig" "on"<br />
Option "Emulate3Buttons" "on"<br />
EndSection<br />
<br />
===通过HAL策略(启用hotplugging)===<br />
如果你已经选择使用[[Xorg input hotplugging]],那么下次你进入X,应该发现你的触摸板无需特别设置就已经可以工作了。<br />
<br />
如果不行的话,或者你需要调整配置,可以删除xorg.conf中相关配置,只保留'''Load "synaptics"'''这行。<br />
<br />
复制/usr/share/hal/fdi/policy/10osvendor/11-x11-synaptics.fdi到/etc/hal/fdi/policy/进行编辑。<br />
<br />
此文件包含以下内容:<br />
<br />
<match key="info.product" contains="Synaptics TouchPad"><br />
<merge key="input.x11_driver" type="string">synaptics</merge><br />
</match><br />
<br />
在每个配置选项的封闭标签'''</match>'''前都必须加入这一行:<br />
<merge key="input.x11_options.RightEdge" type="string">5300</merge><br />
在'''xorg.conf'''中则是:<br />
Option "RightEdge" "5300"<br />
在此'''.fdi'''文件中。<br />
<br />
以下是一个示范的'''<match>'''段,它激活了大部分所需特性:<br />
<br />
<match key="info.product" contains="Synaptics TouchPad"><br />
<merge key="input.x11_driver" type="string">synaptics</merge><br />
<merge key="input.x11_options.AlwaysCore" type="string">true</merge><br />
<merge key="input.x11_options.VertEdgeScroll" type="string">true</merge><br />
<merge key="input.x11_options.HorizEdgeScroll" type="string">true</merge><br />
<merge key="input.x11_options.TapButton1" type="string">1</merge><br />
<merge key="input.x11_options.TapButton2" type="string">2</merge><br />
<merge key="input.x11_options.TapButton3" type="string">3</merge><br />
</match><br />
<br />
==高级设置==<br />
=== Input device选项 ===<br />
synaptics驱动提供许多可以自由定制的选项,下面的列表描述了这些选项,详情可使用'''man synaptics'''命令查看。<br />
<br />
'''Device''' defines where your synaptic device is located. See [[#Troubleshooting | Troubleshooting]] to find your device handler if it isn't /dev/input/mouse0 for you.<br />
<br />
'''MinSpeed''' and '''MaxSpeed''' are set to determine the minimum and maximum speed factor. An floating point value is expected.<br />
<br />
'''AccelFactor''' is the acceleration factor as well defined as a floating point value.<br />
<br />
''' VertScrollDelta''' and ''' HorizScrollDelta''' is an integer value defining scrolling speed. Smaller values result in faster scrolling.<br />
<br />
'''SHMConfig''' is a boolean value (on/off) for activating or deactivating shared memory. This ''must be enabled'' in order to monitor or configure your synaptics device with a client such as synclient, which is discussed below. Shared memory is also required if you want to use [[udev]] rules to disable the touchpad automatically when external mouse is plugged in (see [[#Disabling touchpad on plugged in mouse|the relevant section]] below).<br />
<br />
===Gsynaptics===<br />
如果synaptics驱动已经安装,gnome用户可以安装gsynaptics以使用基于GUI的控制面板:<br />
# pacman -S gsynaptics<br />
<br />
想自动保存和加载gsynaptics配置,在自启动程序里面加入''gsnynaptics-init'':System -> Preferences -> Sessions<br />
<br />
'''''注意:''' 如果不是gnome用户也可以向.xinitrc或者.xsession脚本里面加入'''gsnynaptics-init'''''<br />
<br />
===用synclient调整===<br />
synclient监视器可以实时显示触摸板上的压力和位置,允许更详细调整默认synaptics的设置。为了让synclient能工作,'''SHMConfig'''选项必须是'''on'''或者'''true'''。<br />
<br />
你可以用下面命令启动synaptics监视:<br />
$ synclient -m 100<br />
Where -m activates the monitor and the following number specifies the update interval in milliseconds.<br />
<br />
这个监视器提供你触摸板现在状态信息,例如,如果你用触摸板移动鼠标,监视器中x和y值就会改变。此外,你可以非常容易知道触摸板LeftEdge-, RightEdge-, BottomEdge-和TopEdge-Options的测量值。<br />
<br />
下面是缩写的解释:<br />
<br />
'''time'''<br />
:Time in seconds since the logging was started.<br />
<br />
'''x, y'''<br />
:The x/y coordinates of the finger on the touchpad. The origin is in the upper left corner.<br />
<br />
'''z'''<br />
:The pressure value. It represents the pressure you are using to navigate on your touchpad.<br />
<br />
'''f'''<br />
:Number of fingers currently touching the touchpad.<br />
<br />
'''w'''<br />
:Value that represents the finger width.<br />
<br />
'''l,r,u,d,m,multi'''<br />
: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.<br />
<br />
'''gl,gm,gr'''<br />
: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).<br />
<br />
'''gdx, gdy'''<br />
:x/y coordinates of the guest device.<br />
<br />
如果值一直是0,那么说明你的硬件不支持这个选项。<br />
<br />
了解这些,你应该能知道需要的数据了。<br />
<br />
===实现滚动功能===<br />
要启用触摸板边缘的滚动区域,需增加以下一个或两个选项到/etc/X11/xorg.conf的触摸板设备段:<br />
<br />
Section "InputDevice"<br />
...<br />
Option "VertEdgeScroll" "true" #vertical scrolling when dragging along the right edge.<br />
Option "HorizEdgeScroll" "true" #horizontal scrolling when dragging along the bottom edge.<br />
...<br />
EndSection<br />
<br />
在[[#Configuration_via_HAL_policies_.28hotplugging_enabled.29 | Hotplugging]]的''/etc/hal/fdi/policy/11-x11-synaptics.fdi''中 :<br />
<match key="info.product" contains="Synaptics TouchPad"><br />
...<br />
<merge key="input.x11_options.HorizEdgeScroll" type="string">1</merge><br />
<merge key="input.x11_options.VertEdgeScroll" type="string">1</merge><br />
...<br />
</match><br />
<br />
====两点触摸滚动====<br />
最近的synaptics驱动支持触摸板两个手指来控制滚动。这和Macbook上类似,你可以在触摸板上任何地方同时使用两根手指。<br />
<br />
如果你确认你的触摸板支持这个功能,可以添加如下两行到/etc/X11/xorg.conf的触摸板的设置里面去:<br />
<br />
Section "InputDevice"<br />
...<br />
Option "VertTwoFingerScroll" "true" # vertical scroll anywhere with two fingers<br />
Option "HorizTwoFingerScroll" "true" # horizontal scroll anywhere with two fingers<br />
Option "EmulateTwoFingerMinZ" "120" # this may vary between different machines<br />
...<br />
EndSection<br />
<br />
''EmulateTwoFingerMinZ'' 不是每台机器都需要的,它可以用于几款使用Alps触摸板的Dell机器上。 ([[http://ubuntuforums.org/showthread.php?t=516798&page=2#19 | from Ubuntu forums ]]<br />
<br />
'''对于Firefox用户:'''<br />
你可能发现Firefox水平滚动的默认行为相当的讨厌,那么请看下面的''Firefox和特殊触摸板事件''怎么禁用这功能。<br />
<br />
在[[#Configuration_via_HAL_policies_.28hotplugging_enabled.29 | Hotplugging]]的''/etc/hal/fdi/policy/11-x11-synaptics.fdi''中:<br />
<match key="info.product" contains="Synaptics TouchPad"><br />
...<br />
<merge key="input.x11_options.VertTwoFingerScroll" type="string">1</merge><br />
<merge key="input.x11_options.HorizTwoFingerScroll" type="string">1</merge><br />
<merge key="input.x11_options.EmulateTwoFingerMinZ" type="string">120</merge><br />
...<br />
</match><br />
<br />
===环状滚动(Circular scrolling)===<br />
环状滚动是synaptics提供的一项功能,你可能从iPod上知道了这样的功能。你可以使用画圈来代替或者代替垂直和水平滚动。<br />
你可以向触摸板输入设备这一节中添加如下来启动环状滚动:<br />
<br />
Section "InputDevice"<br />
...<br />
Option "CircularScrolling" "on"<br />
Option "CircScrollTrigger" "0"<br />
...<br />
EndSection<br />
<br />
你可能猜到'''CircularScrolling'''控制启用和禁用环状滚动。'''CircScrollTrigger'''则可能是如下任意一个值,确定环形滚动启动的边缘。<br />
0 All Edges<br />
1 Top Edge<br />
2 Top Right Corner<br />
3 Right Edge<br />
4 Bottom Right Corner<br />
5 Bottom Edge<br />
6 Bottom Left Corner<br />
7 Left Edge<br />
8 Top Left Corner<br />
<br />
如果你同时使用垂直或者水平滚动,那么设置不是0的值比较有帮助。如果你这样做,那么滚动将从你决定的地方开始。<br />
<br />
如果想滚动快点,就在触摸板上画小圈,否则就画大圈。<br />
<br />
===插入鼠标禁用触摸板===<br />
在[[udev]]的帮助下,可以实现自动在外部鼠标插入时禁用触摸板。你需要做的是在udev的规则里面添加:<br />
<br />
ACTION=="add", SUBSYSTEM=="input", ID_CLASS="mouse", RUN+="/usr/bin/synclient TouchpadOff=1"<br />
ACTION=="remove", SUBSYSTEM=="input", ID_CLASS="mouse", RUN+="/usr/bin/synclient TouchpadOff=0"<br />
<br />
把上面内容保存到'''/etc/udev/rules.d/01-touchpad.rules''',而且确保共享内存(SHMConfig)打开。<br />
<br />
===其他功能===<br />
默认触摸板能识别放在触摸板上的手指数目,但ALPS触摸板不行。如果触摸板上放有两根手指,驱动将会虚拟一个中键点击,如果触摸板上有三个手指点击,就会虚拟一个右键点击。<br />
<br />
==提示与技巧==<br />
===插入鼠标禁用触摸板===<br />
在[[udev]]的帮助下,可以实现自动在外部鼠标插入时禁用触摸板。你需要做的是在'''/etc/udev/rules.d/01-touchpad.rules'''里加入以下udev规则:<br />
<br />
ACTION=="add", SUBSYSTEM=="input", ID_CLASS="mouse", RUN+="/usr/bin/synclient TouchpadOff=1"<br />
ACTION=="remove", SUBSYSTEM=="input", ID_CLASS="mouse", RUN+="/usr/bin/synclient TouchpadOff=0"<br />
<br />
共享内存(SHMConfig)必须已被启用。(详情参看[[#Configuration | Configuration]])<br />
<br />
==解决问题==<br />
===我的触摸板硬件位置不在/dev/input/mouse0===<br />
如果这是问题的原因,你可以使用下面的命令来了解你输入设备的信息。<br />
cat /proc/bus/input/devices<br />
搜索名称为"SynPS/2 Synaptics TouchPad"的章节的输入设备。通过这一节的handlers就可以了解xorg.conf中需要使用的硬件。<br />
<br />
'''Example output:'''<br />
I: Bus=0011 Vendor=0002 Product=0007 Version=0000<br />
N: Name="SynPS/2 Synaptics TouchPad"<br />
P: Phys=isa0060/serio4/input0<br />
S: Sysfs=/class/input/input1<br />
H: Handlers=mouse0 event1 <br />
B: EV=b<br />
B: KEY=6420 0 7000f 0<br />
<br />
如果Handlers是mouse0和event1,就使用/dev/input/mouse0的位置。<br />
<br />
===在键盘输入停止触摸板点击===<br />
这是一个简单的小技巧,你可以使触摸板在键盘输入的时候禁用,步骤很简单。加入如下命令到.xinitrc,在启动窗口管理器命令的前面。<br />
<br />
syndaemon -i 2 &<br />
<br />
-i 2设置停止时间为2秒。停止时间即在键盘输入之后多少秒后重新启用触摸板<br />
<br />
另外,你可以使用-t来不阻止触摸板鼠标移动,仅仅禁止点击或者滚动。<br />
syndaemon -t -i 2 &<br />
<br />
和其他命令一样,你可以通过man来了解更多应用:<br />
$ man syndaemon<br />
<br />
===Firefox和特殊触摸板事件===<br />
尽管这些问题不是由驱动引起,但是仍然需要解决。<br />
<br />
默认的,firefox会设置触摸板上特殊区域完成特殊功能。你可以在地址栏输入'''about:config'''设置这些功能。编辑就是双击这些行,让true编程false,如果是数值你就必须手动改变了。<br />
<br />
如果想让firefox不从滚动历史记录,而让它在网页滚动,你可以在about:config里面改变下面两个选项。<br />
mousewheel.horizscroll.withnokey.action = 1<br />
mousewheel.horizscroll.withnokey.sysnumlines = true<br />
<br />
如果不想firefox当你点击触摸板右上(或者鼠标中键)把剪切板里面内容粘贴到地址栏并且打开,你需要设置如下内容为false:<br />
middlemouse.contentLoadURL = false<br />
<br />
===Opera误解水平滚动===<br />
就像上面提到的一样。<br />
修复这个问题,你需要点击工具 -> 首选项 -> 高级 -> 快捷键。在这里设置鼠标属性:删除"Button 5" 和 "Button 6"的定义<br />
<br />
===在LG笔记本上的滚动和多功能===<br />
这些问题可能出现在多种型号的LG笔记本上。 <br />
Symptoms are that when pressing Mouse Button 1 synaptics interpretes it as ScrollUP and a regular button 1 click, same goes for button 2.<br />
<br />
The scrolling can be solved by entering in xorg.conf:<br />
Option "UpDownScrolling" "0"<br />
<br />
This however will make synaptics interprete one button push as three. There is a patch written by Oskar Sandberg, found at http://www.math.chalmers.se/~ossa/linux/lg_tx_express.html , that removes these clicks.<br />
<br />
However when trying to compile this with the latest version of synaptics it fails. The solution to this is using the GIT repository for synaptics. It can be found at http://web.telia.com/~u89404340/touchpad/synaptics/.git .<br />
<br />
There is also a package build file in the archlinux user repository to automate this, http://aur.archlinux.org/packages.php?ID=15983.<br />
<br />
Instructions on how to build this package, after downloading the tarball and unpacking it:<br />
cd synaptics-git<br />
makepkg <br />
<br />
If you want it to be automatically installed after it has build just add '-i' after makepkg.<br />
<br />
===一直不能让外接USB鼠标工作?===<br />
首先,你需要确定你的外部鼠标描述设置里面包含(或者类似)这一行:<br />
<br />
Option "Device" "/dev/input/mice"<br />
<br />
如果"Device"行不一样,改成如上的,并且重新启动X。如果没有解决,修改"Server Layout"设置,将'''touchpad'''设置成 CorePointer:<br />
<br />
InputDevice "Touchpad" "CorePointer"<br />
<br />
然后设置你的外接鼠标为"SendCoreEvents":<br />
<br />
InputDevice "USB Mouse" "SendCoreEvents"<br />
<br />
最后,你需要添加这个到你的外接鼠标设置里面去:<br />
<br />
Option "SendCoreEvents" "true"<br />
<br />
如果还是不行,说不定是鼠标硬件有问题。请检查是不是bug,或者查看论坛,看是否有人有更好的解决方法。<br />
<br />
===Touchpad loses synchronization===<br />
Sometimes the cursor may freeze for several seconds or start acting on its own for no apparent reason. This is accompanied by similar records in /var/log/messages.log<br />
<br />
psmouse.c: TouchPad at isa0060/serio1/input0 lost synchronization, throwing 3 bytes away<br />
<br />
This problem has no general solution, but you may try several possible workarounds.<br />
*If you use cpu frequency scaling, try not using "ondemand" governor and use "performance" governor when possible, since touchpad may lose sync when cpu frequency changes.<br />
*Try not using acpi battery monitor.<br />
*Try to load psmouse with "proto=imps" option. To do that, add this line to your /etc/modprobe.conf<br />
<br />
options psmouse proto=imps<br />
<br />
*Try another desktop environment. Some users report, that this problem only occurs when using Xfce or Gnome and newer occurs under KDE.<br />
*If your touchpad loses sync not only under Linux, but under Windows too, this may be a hardware issue. So, you may need to replace the touchpad itself.<br />
<br />
===我的触摸板不能点击,只能通过触摸板下方或者上方按钮实现===<br />
xorg7.4默认是没有启用这项功能的。你可以通过修改你定义的xorg.conf里面触摸板部分:<br />
Section "InputDevice"<br />
...<br />
Option "TapButton1" "integer" #当你一个手指点击时候效果,一般是1,也就是左键<br />
Option "TapButton2" "integer" #2个手指点击效果,一般是2,也就是鼠标中键<br />
Option "TapButton3" "integer" #3个手指点击效果,一般是3,也就是鼠标右键<br />
...<br />
EndSection<br />
现在,linux下触摸板是不是功能很强大呢?<br />
<br />
===SynPS/2 Synaptics TouchPad can't grab event device, errno=16===<br />
如果你使用Xorg 7.4,查看Xorg日志(/var/log/Xorg.0.log)时候可能会发现有这么一条警告信息。这是因为当使用linux2.6事件协议,驱动默认会试图独占此设备。失败就会出现此条提示。也就是说其他无论是内核空间还是用户空间的程序都无法获取此设备上的信号。当你的xorg.conf里面还定义了一个/dev/misc输入设备时候,这点很有用。但是如果你想测试设备的信号,那么就很麻烦了。<br />
<br />
开启和关闭这项功能,可以修改你定义的xorg.conf的触摸板部分:<br />
<br />
Section "InputDevice"<br />
...<br />
Option "GrabEventDevice" "''boolean''"<br />
...<br />
EndSection<br />
<br />
''boolean''部分可以是yes或者false,分别代表启用和禁止此功能。<br />
<br />
当然你也可以使用synclient来调整,不过不能马上生效,只有触摸板驱动被禁用然后重新启用才能有效果。你可以通过切换到控制台然后切换回来实现。<br />
<br />
==链接==<br />
<br />
Synaptics为XOrg/XFree86的触摸板驱动 :<br />
[http://web.telia.com/~u89404340/touchpad/index.html]</div>Yanghuanhttps://wiki.archlinux.org/index.php?title=Touchpad_Synaptics&diff=67967Touchpad Synaptics2009-05-01T08:52:09Z<p>Yanghuan: /* Configuration via HAL policies (hotplugging enabled) */</p>
<hr />
<div>{{i18n_links_start}}<br />
{{i18n_entry|English|Touchpad Synaptics}}<br />
{{i18n_entry|German|Touchpad Synaptics (Deutsch)}}<br />
{{i18n_entry|Русский|Тачпад Synaptics}}<br />
{{i18n_entry|简体中文|触摸板 (简体中文)}}<br />
{{i18n_links_end}}<br />
<br />
==Introduction==<br />
This article will help install and configure the [http://w1.894.telia.com/~u89404340/touchpad/ synaptics input driver] for Synaptics Touchpads found on most notebooks.<br />
<br />
==Installation==<br />
The synaptics driver is now bundled as ''xf86-input-synaptics'', and is available from the standard repositories:<br />
# pacman -S xf86-input-synaptics<br />
<br />
==Configuration==<br />
There are two options configuring the Synaptics Touchpad. How you do so will depend on whether you have enabled [[Xorg input hotplugging]].<br />
<br />
===Configuration via xorg.conf (hotplugging disabled)===<br />
<br />
Edit ''/etc/X11/xorg.conf'' as root and add '''InputDevice "Touchpad" "SendCoreEvents"''' to the ''ServerLayout'', for example:<br />
Section "ServerLayout"<br />
...<br />
InputDevice "USB Mouse" "CorePointer"<br />
'''''InputDevice "SynapticsTouchpad" "SendCoreEvents"<br />
EndSection<br />
<br />
Add '''Load "synaptics"''' to the ''Module'' section, for example:<br />
Section "Module"<br />
...<br />
Load "glx"<br />
Load "freetype"<br />
'''''Load "synaptics"'''''<br />
...<br />
EndSection<br />
<br />
Lastly, add a new ''InputDevice'' section for the touchpad itself:<br />
Section "InputDevice"<br />
Identifier "SynapticsTouchpad"<br />
Driver "synaptics"<br />
Option "AlwaysCore" "true" # send events to CorePointer<br />
#Option "Device" "/dev/input/mice"<br />
Option "Device" "/dev/psaux"<br />
Option "Protocol" "auto-dev"<br />
Option "SHMConfig" "false" # configurable at runtime? security risk<br />
Option "LeftEdge" "1700" # x coord left<br />
Option "RightEdge" "5300" # x coord right<br />
Option "TopEdge" "1700" # y coord top<br />
Option "BottomEdge" "4200" # y coord bottom<br />
Option "FingerLow" "25" # pressure below this level triggers release<br />
Option "FingerHigh" "30" # pressure above this level triggers touch<br />
Option "MaxTapTime" "180" # max time in ms for detecting tap<br />
'''Option "VertEdgeScroll" "true" # enable vertical scroll zone'''<br />
'''Option "HorizEdgeScroll" "true" # enable horizontal scroll zone'''<br />
Option "CornerCoasting" "true" # enable continuous scroll with finger in corner<br />
Option "CoastingSpeed" "0.30" # corner coasting speed<br />
Option "VertScrollDelta" "100" # edge-to-edge scroll distance of the vertical scroll<br />
Option "HorizScrollDelta" "100" # edge-to-edge scroll distance of the horizontal scroll<br />
Option "MinSpeed" "0.10" # speed factor for low pointer movement<br />
Option "MaxSpeed" "0.60" # maximum speed factor for fast pointer movement<br />
Option "AccelFactor" "0.0020" # acceleration factor for normal pointer movements<br />
Option "VertTwoFingerScroll" "true" # vertical scroll anywhere with two fingers<br />
Option "HorizTwoFingerScroll" "true" # horizontal scroll anywhere with two fingers<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "2"<br />
Option "TapButton3" "3"<br />
EndSection<br />
<br />
The '''bolded''' lines are important because users must now explicitly enable the side and bottom scroll zones of the touchpad. If you already had an InputDevice section configured for the old touchpad driver, you'll still need to add these two lines if you wish to use the scroll zones.<br />
<br />
Save, exit and restart X. The touchpad should now have working scroll zones. You can further tweak the ''InputDevice'' settings if desired. See [[#Advanced_Configuration | Advanced Configuration]] for more information.<br />
<br />
Note that Xorg will automatically load the '''evdev''' and '''psmouse''' kernel modules required by synaptics, however you may also add them explicitly to the MODULES array in the /etc/rc.conf file if desired.<br />
<br />
====ALPS Touchpads====<br />
For ALPS Touchpads, if the above configuration does not provide the desired results, try the following configuration instead:<br />
Section "InputDevice"<br />
Identifier "Touchpad"<br />
Driver "synaptics"<br />
Option "Device" "/dev/input/mouse0"<br />
Option "Protocol" "auto-dev"<br />
Option "LeftEdge" "130"<br />
Option "RightEdge" "840"<br />
Option "TopEdge" "130"<br />
Option "BottomEdge" "640"<br />
Option "FingerLow" "7"<br />
Option "FingerHigh" "8"<br />
Option "MaxTapTime" "180"<br />
Option "MaxTapMove" "110"<br />
Option "EmulateMidButtonTime" "75"<br />
Option "VertScrollDelta" "20"<br />
Option "HorizScrollDelta" "20"<br />
Option "MinSpeed" "0.25"<br />
Option "MaxSpeed" "0.50"<br />
Option "AccelFactor" "0.010"<br />
Option "EdgeMotionMinSpeed" "200"<br />
Option "EdgeMotionMaxSpeed" "200"<br />
Option "UpDownScrolling" "1"<br />
Option "CircularScrolling" "1"<br />
Option "CircScrollDelta" "0.1"<br />
Option "CircScrollTrigger" "2"<br />
Option "SHMConfig" "on"<br />
Option "Emulate3Buttons" "on"<br />
EndSection<br />
<br />
===Configuration via HAL policies (hotplugging enabled)===<br />
If you have chosen to use [[Xorg input hotplugging]], then the next time you enter X, you will likely find that your touchpad works without any further configuration.<br />
<br />
If it does not or you want to tweak the configuration, remove every related configuration from the xorg.conf file. Keep only the '''Load "synaptics"''' line.<br />
<br />
Copy /usr/share/hal/fdi/policy/10osvendor/11-x11-synaptics.fdi into /etc/hal/fdi/policy/(note that in some cases it apparently needs to be renamed to 99-x11-synaptics.fdi). Edit it with your favourite editor.<br />
<br />
The file contains:<br />
<br />
<match key="info.product" contains="Synaptics TouchPad"><br />
<merge key="input.x11_driver" type="string">synaptics</merge><br />
</match><br />
<br />
You have to add a line just before the closing '''</match>''' for every configuration option. What was:<br />
<merge key="input.x11_options.RightEdge" type="string">5300</merge><br />
in the '''xorg.conf''' becomes:<br />
Option "RightEdge" "5300"<br />
in this '''.fdi''' file.<br />
<br />
Here a simple '''<match>''' section to begin with, it activates the most wanted features and leaves many settings alone:<br />
<br />
<match key="info.product" contains="Synaptics TouchPad"><br />
<merge key="input.x11_driver" type="string">synaptics</merge><br />
<merge key="input.x11_options.AlwaysCore" type="string">true</merge><br />
<merge key="input.x11_options.VertEdgeScroll" type="string">true</merge><br />
<merge key="input.x11_options.HorizEdgeScroll" type="string">true</merge><br />
<merge key="input.x11_options.TapButton1" type="string">1</merge><br />
<merge key="input.x11_options.TapButton2" type="string">2</merge><br />
<merge key="input.x11_options.TapButton3" type="string">3</merge><br />
</match><br />
<br />
If the above config does not work for you, try this one:<br />
<br />
<?xml version="1.0" encoding="ISO-8859-1"?><br />
<deviceinfo version="0.2"><br />
<device><br />
<match key="info.capabilities" contains="input.touchpad"><br />
<match key="info.product" contains="Synaptics TouchPad"><br />
<merge key="input.x11_driver" type="string">synaptics</merge><br />
<!-- Arbitrary options can be passed to the driver using<br />
the input.x11_options property since xorg-server-1.5. --><br />
<!-- EXAMPLE:<br />
<merge key="input.x11_options.LeftEdge" type="string">120</merge><br />
--><br />
</match><br />
<match key="info.product" contains="AlpsPS/2 ALPS"><br />
<merge key="input.x11_driver" type="string">synaptics</merge><br />
</match><br />
<match key="info.product" contains="appletouch"><br />
<merge key="input.x11_driver" type="string">synaptics</merge><br />
</match><br />
<match key="info.product" contains="bcm5974"><br />
<merge key="input.x11_driver" type="string">synaptics</merge><br />
</match><br />
<merge key="input.x11_options.protocol" type="string">event</merge><br />
<merge key="input.x11_options.touchpadoff" type="string">0</merge><br />
<merge key="input.x11_options.shmconfig" type="string">on</merge><br />
<merge key="input.x11_options.TapButton1" type="string">1</merge><br />
<merge key="input.x11_options.TapButton2" type="string">2</merge><br />
<merge key="input.x11_options.TapButton3" type="string">3</merge><br />
<merge key="input.x11_options.vertedgescroll" type="string">true</merge><br />
<merge key="input.x11_options.horizedgescroll" type="string">true</merge><br />
<merge key="input.x11_options.RightEdge" type="string">930</merge><br />
<merge key="input.x11_options.BottomEdge" type="string">700</merge><br />
<merge key="input.x11_options.VertTwoFingerScroll" type="string">true</merge><br />
<merge key="input.x11_options.HorizTwoFingerScroll" type="string">true</merge><br />
<merge key="input.x11_options.HorizScrollDelta" type="string">20</merge><br />
</match><br />
</device><br />
</deviceinfo><br />
<br />
Or, if you find hal is not loading your settings, try this one. Note the "append key" line, required in some systems. Then add the options you prefer.<br />
<br />
<pre><br />
<?xml version="1.0" encoding="ISO-8859-1"?><br />
<deviceinfo version="0.2"><br />
<device><br />
<match key="info.product" contains="SynPS/2 Synaptics TouchPad"><br />
<append key="info.capabilities" type="strlist">input.touchpad</append><br />
</match> <br />
<match key="info.capabilities" contains="input.touchpad"><br />
<merge key="input.x11_driver" type="string">synaptics</merge><br />
<merge key="input.x11_options.TapButton1" type="string">1</merge><br />
<merge key="input.x11_options.TapButton2" type="string">3</merge><br />
<merge key="input.x11_options.TapButton3" type="string">2</merge><br />
</match><br />
</device><br />
</deviceinfo><br />
</pre><br />
<br />
==Advanced Configuration==<br />
=== Input device options ===<br />
The synaptics driver offers a number of options that can be customized. The following is a brief list of some of these options--see '''man synaptics''' for full details:<br />
<br />
'''Device''' defines where your synaptic device is located. See [[#Troubleshooting | Troubleshooting]] to find your device handler if it isn't /dev/input/mouse0 for you.<br />
<br />
'''MinSpeed''' and '''MaxSpeed''' are set to determine the minimum and maximum speed factor. An floating point value is expected.<br />
<br />
'''AccelFactor''' is the acceleration factor as well defined as a floating point value.<br />
<br />
''' VertScrollDelta''' and ''' HorizScrollDelta''' is an integer value defining scrolling speed. Smaller values result in faster scrolling.<br />
<br />
'''SHMConfig''' is a boolean value (on/off) for activating or deactivating shared memory. This ''must be enabled'' in order to monitor or configure your synaptics device with a client such as synclient, which is discussed below. Shared memory is also required if you want to use [[udev]] rules to disable the touchpad automatically when external mouse is plugged in (see [[#Disabling touchpad on plugged in mouse|the relevant section]] below).<br />
<br />
===Gsynaptics===<br />
Once the touchpad is configured, GNOME users can also install the '''gsynaptics''' package to enable a GUI-based control panel for the device:<br />
# pacman -S gsynaptics<br />
<br />
To save and load the settings from gsynaptics automatically, add '''gsynaptics-init''' to the list of ''Startup Programs'' found in ''System -> Preferences -> Sessions''.<br />
<br />
'''''Note:''' Non-GNOME users can also use gsynaptics by instead adding '''gsynaptics-init''' to their .xinitrc or .xsession startup scripts.''<br />
<br />
'''''Note:''' The '''gsynaptics''' web page [http://gsynaptics.sourceforge.jp/] indicates that it is becoming obsolete and users should consider '''GPointingDeviceSettings''' [http://live.gnome.org/GPointingDeviceSettings], currently available in AUR and as source code.''<br />
<br />
'''''Hotplugging Enabled:'''<br />
If you have hotplugging enabled you will need to make a new file in /etc/hal/fdi/policy called shmconfig.fdi with the following content.<br />
<br />
<br />
<?xml version="1.0" encoding="ISO-8859-1"?><br />
<deviceinfo version="0.2"><br />
<device><br />
<match key="input.x11_driver" string="synaptics"><br />
<merge key="input.x11_options.SHMConfig" type="string">True</merge><br />
</match><br />
</device><br />
</deviceinfo><br />
<br />
===Fine tuning with synclient===<br />
The synclient monitor can display pressure and placement on the touchpad in real-time, allowing further refinement of the default synaptics settings. In order for synclient to work properly, the '''SHMConfig''' option must be set to '''on''' or '''true'''.<br />
<br />
You can start the synaptics monitor with the following command:<br />
$ synclient -m 100<br />
Where -m activates the monitor and the following number specifies the update interval in milliseconds.<br />
<br />
This monitor provides information about the current state of your touchpad. For example, if you move the mouse with the touchpad, the x and y values in the monitor will change. Therewith you can easy figure out your touchpad's dimension which is defined in the LeftEdge-, RightEdge-, BottomEdge- and TopEdge-Options.<br />
<br />
The abbreviations are explained as following:<br />
<br />
'''time'''<br />
:Time in seconds since the logging was started.<br />
<br />
'''x, y'''<br />
:The x/y coordinates of the finger on the touchpad. The origin is in the upper left corner.<br />
<br />
'''z'''<br />
:The pressure value. It represents the pressure you are using to navigate on your touchpad.<br />
<br />
'''f'''<br />
:Number of fingers currently touching the touchpad.<br />
<br />
'''w'''<br />
:Value that represents the finger width.<br />
<br />
'''l,r,u,d,m,multi'''<br />
: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.<br />
<br />
'''gl,gm,gr'''<br />
: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).<br />
<br />
'''gdx, gdy'''<br />
:x/y coordinates of the guest device.<br />
<br />
If a value constantly is zero, it means that this option is not supported by your device.<br />
<br />
With this in mind you should be able to figure the proper values out for you.<br />
<br />
===Edge scrolling===<br />
To enable the scroll zones found along the edges of the touchpad, add one or both of the following options to the touchpad device section in /etc/X11/xorg.conf:<br />
<br />
Section "InputDevice"<br />
...<br />
Option "VertEdgeScroll" "true" #vertical scrolling when dragging along the right edge.<br />
Option "HorizEdgeScroll" "true" #horizontal scrolling when dragging along the bottom edge.<br />
...<br />
EndSection<br />
<br />
In ''/etc/hal/fdi/policy/11-x11-synaptics.fdi''(or if that doesn't work, ''/etc/hal/fdi/policy/99-x11-synaptics.fdi) for [[#Configuration_via_HAL_policies_.28hotplugging_enabled.29 | Hotplugging]]:<br />
<match key="info.product" contains="Synaptics TouchPad"><br />
...<br />
<merge key="input.x11_options.HorizEdgeScroll" type="string">1</merge><br />
<merge key="input.x11_options.VertEdgeScroll" type="string">1</merge><br />
...<br />
</match><br />
<br />
===Two-Finger scrolling===<br />
Recent synaptics touchpads support two-finger scrolling. This allows you to use two fingers together anywhere on the touchpad, similar to the behaviour of Macbooks.<br />
<br />
If your hardware supports this feature, you can enable it by inserting the following lines into the touchpad device section of /etc/X11/xorg.conf:<br />
Section "InputDevice"<br />
...<br />
Option "VertTwoFingerScroll" "true" # vertical scroll anywhere with two fingers<br />
Option "HorizTwoFingerScroll" "true" # horizontal scroll anywhere with two fingers<br />
Option "EmulateTwoFingerMinZ" "120" # this may vary between different machines<br />
...<br />
EndSection<br />
<br />
''EmulateTwoFingerMinZ'' is only necessary for the Alps Touchpad, which several Dell machines have. ([http://ubuntuforums.org/showthread.php?t=516798&page=2#19 from Ubuntu forums])<br />
<br />
'''Firefox users:''' You might find the default behaviour of Firefox pretty annoying relating to the horizontal scrolling. Just see ''Firefox and special touchpad events'' below to find out how to disable it.<br />
<br />
In ''/etc/hal/fdi/policy/11-x11-synaptics.fdi''(or ''/etc/hal/fdi/policy/99-x11-synaptics.fdi'') for [[#Configuration_via_HAL_policies_.28hotplugging_enabled.29 | Hotplugging]]:<br />
<match key="info.product" contains="Synaptics TouchPad"><br />
...<br />
<merge key="input.x11_options.VertTwoFingerScroll" type="string">1</merge><br />
<merge key="input.x11_options.HorizTwoFingerScroll" type="string">1</merge><br />
<merge key="input.x11_options.EmulateTwoFingerMinZ" type="string">120</merge><br />
...<br />
</match><br />
<br />
===Circular scrolling===<br />
Circular scrolling is a feature that synaptics offers which closely resembles the behaviour of iPods. Instead of (or additional to) scrolling horizontally or vertically, you can scroll circularly. Some users find this faster and more precise.<br />
To enable circular scrolling, add the following options to the touchpad device section of /etc/X11/xorg.conf:<br />
Section "InputDevice"<br />
...<br />
Option "CircularScrolling" "on"<br />
Option "CircScrollTrigger" "0"<br />
...<br />
EndSection<br />
<br />
In ''/etc/hal/fdi/policy/11-x11-synaptics.fdi''(or ''/etc/hal/fdi/policy/99-x11-synaptics.fdi'') for [[#Configuration_via_HAL_policies_.28hotplugging_enabled.29 | Hotplugging]]:<br />
<match key="info.product" contains="Synaptics TouchPad"><br />
...<br />
<merge key="input.x11_options.CircularScrolling" type="string">on</merge><br />
<merge key="input.x11_options.CircScrollTrigger" type="string">0</merge><br />
...<br />
</match><br />
<br />
The option '''CircScrollTrigger''' may be one of the following values, determining which edge circular scrolling should start:<br />
0 All Edges<br />
1 Top Edge<br />
2 Top Right Corner<br />
3 Right Edge<br />
4 Bottom Right Corner<br />
5 Bottom Edge<br />
6 Bottom Left Corner<br />
7 Left Edge<br />
8 Top Left Corner<br />
<br />
Specifying something different from zero may be useful if you want to use circular scrolling in conjunction with horizontal and/or vertical scrolling. If you do so, the type of scrolling is determined by the edge you're starting.<br />
<br />
To scroll fast, draw small circles in the center of your touchpad. To scroll slowly and more precise, draw large circles.<br />
<br />
===Other features===<br />
By default, Synaptics touchpads are able to detect the number of fingers on the touchpad, ALPS touchpads are not. If the touchpad is tapped with two fingers, it will emulate a middle click. If the touchpad is typed with three fingers, a right click will be emulated.<br />
<br />
==Tips & Tricks==<br />
===Disable touchpad upon external mouse detection===<br />
In assistance to [[udev]], it is possible to automatically disable the touchpad if an external mouse has been plugged in. To achieve this, add the following udev rule to '''/etc/udev/rules.d/01-touchpad.rules''':<br />
ACTION=="add", SUBSYSTEM=="input", ID_CLASS="mouse", RUN+="/usr/bin/synclient TouchpadOff=1"<br />
ACTION=="remove", SUBSYSTEM=="input", ID_CLASS="mouse", RUN+="/usr/bin/synclient TouchpadOff=0"<br />
<br />
SHMConfig must be enabled (see the [[#Configuration | Configuration]] section for details)<br />
<br />
==Troubleshooting==<br />
===My touchpad device isn't located at /dev/input/mouse0===<br />
If that's the case, you can use this command to display information about your all input devices:<br />
cat /proc/bus/input/devices<br />
Search for an input device which has the name "SynPS/2 Synaptics TouchPad". The Handler in this section will tell you which Device you have to specify in your xorg.conf.<br />
<br />
'''Example output:'''<br />
I: Bus=0011 Vendor=0002 Product=0007 Version=0000<br />
N: Name="SynPS/2 Synaptics TouchPad"<br />
P: Phys=isa0060/serio4/input0<br />
S: Sysfs=/class/input/input1<br />
H: Handlers=mouse0 event1 <br />
B: EV=b<br />
B: KEY=6420 0 7000f 0<br />
<br />
As your Handlers are mouse0 and event1, you use /dev/input/mouse0.<br />
<br />
===Stopping the mouse from clicking while typing===<br />
This is a neat little trick incorporated with the synaptics driver, you can actually make sure that the touchpad is disabled while typing. It is a very simple procedure, so here is how it is done.<br />
<br />
Just add the following line to your .xinitrc before you run your window manager:<br />
syndaemon -i 2 &<br />
<br />
The '''-i 2''' switch sets the idle time to 2 seconds. The idle time specifies how many seconds to wait after the last key press before enabling the touchpad again.<br />
<br />
Additionally you can add the '''-t''' switch that tells the daemon not to disable mouse movement when typing and only disable tapping and scrolling:<br />
syndaemon -t -i 2 &<br />
<br />
As usual you may find further information in the manpage:<br />
$ man syndaemon<br />
<br />
Note: Don't forget to turn on SHMConfig in your xorg-setup, either in /etc/xorg.conf (hotplugging disabled) or in /etc/hal/fdi/policy/11-x11-synaptics.fdi (hotplugging enabled). Some users may need to specify touchpad preferences in /etc/hal/fdi/policy/99-x11-synaptics.fdi, instead.<br />
<br />
Note: If you're using GDM as your login manager and Gnome, GDM will ignore commands added to .xinitrc, other than the command to start Gnome. To start syndaemon you need to use Gnome's Startup Applications Preferences program. Login to Gnome and go to System > Preferences > Startup Applications. In the Startup Programs tab click the Add button. Name the Startup Program whatever you like and input any comments you like (or leave this field blank). In the command field add:<br />
syndaemon -i 2 -d<br />
<br />
The "-d" option is necessary to start syndaemon as a background process, instead of the "&" which does this in .xinitrc. You can add other options as well, the same way you would in .xinitrc. When you're done click the Add button in the Add Startup Program dialogue. Make sure the check box next to the startup program you've created is checked, in the list of additional startup programs. Close the Startup Applications Preferences window and you're done.<br />
<br />
===Firefox and special touchpad events===<br />
Even though this problem isn't concerning the synaptics drivers, you will probably look up here for a solution anyway.<br />
By default firefox is set up to do special events on tapping or scrolling certain parts of your touchpad. <br />
You can edit the settings of those actions by typing '''about:config''' in your firefox address bar.<br />
Editing takes place by double clicking on those lines, true changes to false and vise versa, a numerical value you'll have to change manually.<br />
<br />
To prevent firefox from scrolling (back and forward) through the history and make it scroll the site, you have to edit the following settings:<br />
mousewheel.horizscroll.withnokey.action = 1<br />
mousewheel.horizscroll.withnokey.sysnumlines = true<br />
<br />
To prevent firefox from redirecting you to urls formed out of your clipboard content, on tapping the upper-rigt corner of your touchpad (or middle mouse button), you have to set the following line to false:<br />
middlemouse.contentLoadURL = false<br />
<br />
===Opera misinterprets horizontal scrolling===<br />
Same as above.<br />
To fix it, go to Tools -> Preferences -> Advanced -> Shortcuts. There you edit the mouse preferences: Delete the entries with "Button 5" and "Button 6".<br />
<br />
===Scrolling and multiple actions with synaptics on LG Laptops===<br />
These problems seems to be occurring on several models of LG laptops. <br />
Symptoms are that when pressing Mouse Button 1 synaptics interprets it as ScrollUP and a regular button 1 click, same goes for button 2.<br />
<br />
The scrolling can be solved by entering in xorg.conf:<br />
Option "UpDownScrolling" "0"<br />
<br />
This however will make synaptics interpret one button push as three. There is a patch written by Oskar Sandberg, found at http://www.math.chalmers.se/~ossa/linux/lg_tx_express.html , that removes these clicks.<br />
<br />
However when trying to compile this with the latest version of synaptics it fails. The solution to this is using the GIT repository for synaptics. It can be found at http://web.telia.com/~u89404340/touchpad/synaptics/.git .<br />
<br />
There is also a package build file in the archlinux user repository to automate this, http://aur.archlinux.org/packages.php?ID=15983.<br />
<br />
Instructions on how to build this package, after downloading the tarball and unpacking it:<br />
cd synaptics-git<br />
makepkg <br />
<br />
If you want it to be automatically installed after it has build just add '-i' after makepkg.<br />
<br />
===Still can't get your USB (external) mouse working?===<br />
First, make sure your section describing the external mouse contains this line (or that the line looks like this):<br />
<br />
Option "Device" "/dev/input/mice"<br />
<br />
If the "Device" line is different, change it to the above, and try to restart X. If this doesn't solve your problem, make your '''touchpad''' the CorePointer in the "Server Layout" section:<br />
<br />
InputDevice "Touchpad" "CorePointer"<br />
<br />
and make your external device "SendCoreEvents":<br />
<br />
InputDevice "USB Mouse" "SendCoreEvents"<br />
<br />
finally add this to your external device's section:<br />
<br />
Option "SendCoreEvents" "true"<br />
<br />
If all of the above doesn't work for you, please check relevant bug trackers for possible bugs, or go through the forums to see if anyone has found a better solution.<br />
<br />
===Touchpad loses synchronization===<br />
Sometimes the cursor may freeze for several seconds or start acting on its own for no apparent reason. This is accompanied by similar records in /var/log/messages.log<br />
<br />
psmouse.c: TouchPad at isa0060/serio1/input0 lost synchronization, throwing 3 bytes away<br />
<br />
This problem has no general solution, but you may try several possible workarounds.<br />
*If you use cpu frequency scaling, try not using "ondemand" governor and use "performance" governor when possible, since touchpad may lose sync when cpu frequency changes.<br />
*Try not using acpi battery monitor.<br />
*Try to load psmouse with "proto=imps" option. To do that, add this line to your /etc/modprobe.conf<br />
<br />
options psmouse proto=imps<br />
<br />
*Try another desktop environment. Some users report, that this problem only occurs when using Xfce or Gnome and newer occurs under KDE.<br />
*If your touchpad loses sync not only under Linux, but under Windows too, this may be a hardware issue. So, you may need to replace the touchpad itself.<br />
<br />
===Touchpad doesn't have tapping function===<br />
Xorg v7.4 does not enable tapping by default. To enable, simply add following to the touchpad's InputDevice section in <tt>/etc/X11/xorg.conf</tt>:<br />
<br />
Section "InputDevice"<br />
...<br />
Option "TapButton1" "''integer''"<br />
Option "TapButton2" "''integer''"<br />
Option "TapButton3" "''integer''"<br />
...<br />
EndSection<br />
The ''integer'' of option "TapButton1" means which mouse button is reported on a non-corner one-finger tap. Usually it is 1.<br />
The ''integer'' of option "TapButton2" means which mouse button is reported on a non-corner two-finger tap. Usually it is 2.<br />
The ''integer'' of option "TapButton3" means which mouse button is reported on a non-corner three-finger tap. Usually it is 3.<br />
<br />
===There is a delay between a button tap and the actual click===<br />
If you experience a delay between the tap on the touchpad and the actual click that is registered you need to enable FastTaps:<br />
If you're using xorg-server with disabled input hotplugging change xorg.conf so that you have:<br />
<br />
Section "InputDevice"<br />
Identifier "Synaptics Touchpad"<br />
Driver "synaptics"<br />
...<br />
Option "FastTaps" "1"<br />
...<br />
EndSection<br />
<br />
If you're using input hotplugging change your 11-x11-synaptics.fdi(or 99-x11-synaptics.fdi, in some cases) so that it contains:<br />
<br />
<merge key="input.x11_options.FastTaps" type="string">1</merge><br />
===SynPS/2 Synaptics TouchPad can't grab event device, errno=16===<br />
If you are using Xorg7.4, you may get a warning like this from /var/log/Xorg.0.log, that's because the driver will grab the event device for exclusive use when using the linux 2.6 event protocol. When it fails, X will warn this message.<br />
<br />
Grabbing the event device means that no other user space or kernel space program sees the touchpad events. This is desirable if the X config file includes /dev/input/mice as an input device, but is undesirable if you want to monitor the device from user space. <br />
<br />
if you want to control it, add or modify the "GrabEventDevice" option in you touchpad section in xorg.conf:<br />
<br />
...<br />
Option "GrabEventDevice" "''boolean''"<br />
...<br />
<br />
That will affect when next time you start X, and you can also change it by using synclient. When changing this parameter with the synclient program, the change will not take effect until the synaptics driver is disabled and re-enabled. This can be achieved by switching to a text console and then switching back to X.<br />
<br />
==Other Resources==<br />
<br />
Synaptics TouchPad driver for XOrg/XFree86 :<br />
[http://web.telia.com/~u89404340/touchpad/index.html]<br />
<br />
[[Category:Mouse]]<br />
[[Category:HOWTOs (English)]]</div>Yanghuanhttps://wiki.archlinux.org/index.php?title=Localization_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)/Simplified_Chinese_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=67965Localization (简体中文)/Simplified Chinese (简体中文)2009-05-01T06:57:45Z<p>Yanghuan: /* JAVA界面乱码 */</p>
<hr />
<div>[[Category:General (简体中文)]]<br />
[[Category:简体中文]]<br />
<br />
请再仔细看看Arch的哲学"[[Arch之道]]":<br />
这意味着我们不会为你配置好一切,因为“喜好和需求,每人皆不同”,但是我们会尽量确保让你自行配置时,方便和简单。事实上,甚至远比你使用一些可能的Linux中文版本容易。<br />
<br />
第一次使用ArchLinux时,用户通常会遇上这些(典型)的问题:<br />
<br />
== '''怎么显示中文的界面?''' ==<br />
要正确实现中文,必需设置正确的locale和安装合适的中文字体。<br />
<br />
===locale的设定===<br />
Linux中通过locale来设置程序运行的不同环境。一般常用的中文locale有:<br />
zh_CN.GBK<br />
zh_CN.GB2312<br />
zh_CN.UTF-8<br />
推荐使用UTF8的locale。需要注意的是,对于glibc(>=2.3.6),需要修改/etc/locale.gen文件来设定系统中可以使用的locale<br />
en_US.UTF8 UTF-8<br />
zh_CN.UTF8 UTF-8<br />
zh_CN.GBK GBK<br />
zh_CN.GB2312 GB2312<br />
zh_CN.GB18030 GB18030<br />
然后执行locale-gen命令,这样便可以在系统中使用zh_CN.UTF8,zh_CN.GBK,zh_CN.GB2312,zh_CN.GB18030,en_US.UTF8等locale。可以通过locale命令来查看当前使用的locale<br />
locale<br />
可以通过locale命令来查看目前可以使用的locale<br />
locale -a<br />
<br />
Archlinux中,通过rc.conf文件可以设置全局有效的locale:<br />
LOCALE=en_US.UTF-8<br />
<br />
对于个人用户,还可以在.bashrc或.xprofile中设置自己的用户环境,不同之处在于:<br />
*.bashrc: 每次'''终端登录时'''读取并运用里面的设置。<br />
*.xinitrc: 每次'''startx启动X界面时'''读取并运用里面的设置<br />
*.xprofile: 每次'''使用gdm等图形登录时'''读取并运用里面的设置<br />
<br />
在终端(文字)界面下也可以显示和输入中文,但需要安装cce和zhcon。<br />
更多的locale信息可以参见:<br />
<br />
===安装中文字体===<br />
除了设置好locale,你还需要安装中文字体:<br />
pacman -S wqy-zenhei<br />
<br />
常用的免费(GPL或兼容版权)中文字体有<br />
wqy-bitmapfont<br />
wqy-zenhei<br />
ttf-arphic-ukai<br />
ttf-arphic-uming<br />
ttf-fireflysung<br />
<br />
<br />
系统字体将默认安装到/usr/share/fonts,如果你没有root权限或者只打算自己使用某些字体,你可以直接复制这些字体到.fonts(或者其他)目录下面,并把该路径加入/etc/fonts/local.conf中,参见后面章节。<br />
<br />
已知问题:<br />
*ttf-fireflysung错误的依赖了xorg-clients-utils而不是xorg-fonts-utiles,参见bug报告:<br />
<br />
参考网点:<br />
*http://wiki.debian.org.hk/w/Where_can_I_find_fonts_for_GNU/Linux<br />
<br />
==fontconfig设置==<br />
安装好字体以后,你可能对中文字体的显示不太满意。这时需要对fontconfig做某些设置。你可以在~/.fonts.conf中设定,也可以在/etc/fonts/conf.d中设定。<br />
<br />
===重排字型的显示顺序===<br />
Serifs字型<br />
<alias><br />
<family>serif</family><br />
<prefer><br />
<family>Bitstream Vera Serif</family><br />
<family>Times New Roman</family><br />
<family>Nimbus Roman No9 L</family><br />
<family>Luxi Serif</family><br />
<family>Times</family><br />
<family>WenQuanYi Bitmap Song</family> <br />
<family>AR PL ShanHeiSun Uni</family><br />
<family>AR PL New Sung</family><br />
<family>AR PL ZenKai Uni</family><br />
<family>Ming(ISO10646)</family><br />
<family>Kochi Mincho</family><br />
<family>Baekmuk Batung</family><br />
</prefer><br />
</alias><br />
Sans字型<br />
<alias><br />
<family>sans-serif</family><br />
<prefer><br />
<family>Bitstream Vera Sans</family><br />
<family>Verdana</family><br />
<family>Arial</family><br />
<family>Tahoma</family><br />
<family>WenQuanYi Bitmap Song</family> <br />
<family>AR PL ShanHeiSun Uni</family><br />
<family>AR PL New Sung</family><br />
<family>AR PL ZenKai Uni</family><br />
<family>Helvetica</family><br />
<family>Ming(ISO10646)</family><br />
<family>Kochi Gothic</family><br />
<family>Baekmuk Dotum</family><br />
</prefer><br />
</alias><br />
Mononspace字型 <br />
<alias><br />
<family>monospace</family><br />
<prefer><br />
<family>Bitstream Vera Sans Mono</family><br />
<family>Courier</family><br />
<family>Courier New</family><br />
<family>Andale Mono</family><br />
<family>Luxi Mono</family><br />
<family>Nimbus Mono L</family><br />
<family>WenQuanYi Bitmap Song</family><br />
<family>AR PL ShanHeiSun Uni</family><br />
<family>AR PL New Sung</family><br />
<family>AR PL ZenKai Uni</family><br />
<family>Ming(ISO10646)</family><br />
<family>Kochi Mincho</family><br />
<family>Baekmuk Batung</family><br />
</prefer><br />
</alias><br />
<br />
===关闭小号字体的AA(反锯齿)===<br />
对于比较小的字体,关闭小号字体的反锯齿,会更加清晰。<br />
<match target="font" ><br />
<test compare="eq" name="family" qual="any" ><br />
<string>AR PL New Sung</string><br />
<string>AR PL ShanHeiSun Uni</string><br />
<string>AR PL ZenKai Uni</string><br />
<string>AR PL Mingti2L Big5</string><br />
<string>AR PL SungtiL Big5</string><br />
<string>MingLiu</string><br />
<string>PMingLiu</string><br />
</test><br />
<test compare="more_eq" name="pixelsize" ><br />
<double>8</double><br />
</test><br />
<test compare="less_eq" name="pixelsize" ><br />
<double>15</double><br />
</test><br />
<edit name="antialias" ><br />
<bool>false</bool><br />
</edit><br />
<edit name="hinting" ><br />
<bool>true</bool><br />
</edit><br />
</match><br />
<br />
'''Tips:'''可以到这里得到更详细的[[字体设置]]文档和完整的[[中文字体配置范例]]<br />
<br />
'''参考文档'''<br />
*Fontconfig用户手册 http://www.chinalinuxpub.com/read.php?wid=634<br />
*令Debian支援中文 http://wiki.linux.org.hk/w/Make_Debian_support_Chinese<br />
*http://www.higherorder.org/wiki/Fontconfig<br />
<br />
== '''怎么输入中文?''' ==<br />
安装相应的输入法 [[scim]] 或者 [[fcitx]]。推荐使用scim:<br />
pacman -S scim-pinyin<br />
简体中文的用户推荐:<br />
scim-pinyin 智能拼音<br />
scim-tables 五笔<br />
繁体中文的用户推荐:<br />
scim-chewing<br />
<br />
要使用scim,还应该设置以下的环境变量(以scim为例),(可在xinitrc, .bashrc或.xprofile中设置)<br />
export XIM="SCIM"<br />
export XMODIFIERS=@im=SCIM #设置scim为xim默认输入法<br />
export GTK_IM_MODULE=scim #设置scim为gtk程序默认的输入法<br />
export QT_IM_MODULE=scim #设置scim为qt程序默认的输入法<br />
export XIM_PROGRAM="scim -d" #使可以自动启动<br />
<br />
已知问题:<br />
*由于SCIM的ABI兼容性问题,目前可能会造成一些软件拒绝运行,这些软件包括但不限于:Acrobat Reader, openoffice,直接从mozilla.org下载的firefox, thunderbird,以及realplay。权宜之计: 在程序的启动文件头输入:<br />
*目前scim在QT程序中还不能做到光标跟随<br />
<br />
'''Tip''':为什么推荐使用SCIM?<br />
*因为到目前为止,SCIM是惟一的“傻瓜式”输入法(感谢作者付出的很多努力,最终让我们打包和维护相当的轻松,而且对于用户来说,也基本不需要什么设置)。<br />
<br />
== '''中文显示很模糊(淡),或没有中文粗体?''' ==<br />
在正常情况下,gnome本身已经转由cairo+pango来渲染字体,不存在这个问题了,但是你很可能在浏览一些网页时,还会发生这些问题。<br />
<br />
没有中文粗体解决方法:<br />
<br />
把下面的配置加入/etc/fonts/local.conf<br />
<pre><br />
<!--<br />
Synthetic emboldening for fonts that do not have bold face available<br />
--><br />
<br />
<match target="font"><br />
<!-- check to see if the font is just regular --><br />
<test name="weight" compare="less_eq"><br />
<const>medium</const><br />
</test><br />
<!-- check to see if the pattern requests bold --><br />
<test target="pattern" name="weight" compare="more"><br />
<const>medium</const><br />
</test><br />
<!--<br />
set the embolden flag<br />
needed for applications using cairo, e.g. gucharmap, gedit, ...<br />
--><br />
<edit name="embolden" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
<!--<br />
set weight to bold<br />
needed for applications using Xft directly, e.g. Firefox, ...<br />
--><br />
<edit name="weight" mode="assign"><br />
<const>bold</const><br />
</edit><br />
</match><br />
</pre><br />
<br />
或者使用了下面的local.conf文件替换系统默认的local.conf文件。<br />
cp local.conf /etc/fonts/ <br />
或者,自行编译fontconfig2.3.92以上的版本,并打开local.conf中的autohint<br />
<br />
KDE环境:对不起,我不知道,我已经超过1年多没有用KDE了。欢迎各位的补充<br />
其他环境:见上。<br />
<br />
*官方新版本的mozila firefox(大于1.5.0.1)已经使用cairo+pango,但是在某些网站时会相当的慢。<br />
<br />
== '''如何显示影片的中文字幕?''' ==<br />
===mplayer===<br />
修改~/.mplayer/config<br />
font=/usr/share/fonts/TTF/uming.ttf<br />
subcp=cp936<br />
<br />
可以使用下面的命令手动加载字幕<br />
mplayer xxx.avi -sub xxxxx.srt<br />
同时,你还可以设置mplayer自动加载字幕。如果你无法在gmplayer的选项中找到这个选项(天知道你会有这样粗心),直接修改~/.mplayer/gui.conf如下:<br />
sub_auto_load = "yes"<br />
sub_unicode = "yes"<br />
sub_pos = "100"<br />
sub_overlap = "no"<br />
sub_cp = "cp936"<br />
font_factor = "0.750000"<br />
font_encoding = "unicode"<br />
<br />
*mplayer cvs(2005.12以后)已经使用了gtk2的界面,但是很遗憾的是并没有完全利用gtk2良好的国际支持,甚至没有使用gtk.filechooser。<br />
*正体中文 codepage 为 cp950。<br />
<br />
===SMPlayer===<br />
SMPlayer 是一个基于QT的MPlayer前端。显示中文字幕很方便。只要在设置对话框里设定缺省字幕编码和字体即可。而且立即生效,无需重新启动程序。<br />
<br />
===xine===<br />
xine也可以显示中文字幕,但需要制作自己的中文字体。具体可以参考<br />
http://forum.ubuntu.org.cn/about2760.html<br />
<br />
===gstreamer===<br />
在totem 1.4.0,由于使用gstreamer0.10,应该是可以自动加载同名的srt字幕。<br />
<br />
== '''MP3文件在播放器中乱码''' ==<br />
对于所有用gstreamer做后端的播放器,如Rhythmbox,totem,设置如下的环境变量后即可正确读取mp3中GBK编码的id3 tag。<br />
export GST_ID3_TAG_ENCODING=GBK:UTF-8:GB18030<br />
export GST_ID3V2_TAG_ENCODING=GBK:UTF-8:GB18030<br />
<br />
对于Beep media player,可以在pefenrence->plugins->media中选中MPEG Audio plugin然后点击下方的Penfenrences,此时会出现一个对话框,选择title,将Disable ID3v2和Convert non-UTF8 ID3 tags to UTF8前的选择框选中。然后在ID3 encoding中填入 gbk。这样bmp就能正确显示GBK编码的ID3 tag。<br />
<br />
Quod Libet播放器支持tag编辑及设置id3v2编码。可以在~/.quodlibet/config中设置<br />
id3encoding = gbk<br />
注意:Quod Libet默认支持utf8编码<br />
<br />
最为彻底的解决方法为将编码为gbk的id3 tag转化为utf8编码。首先安装mutagen,然后利用下面的命令转化:<br />
mid3iconv -e gbk test.mp3<br />
<br />
== '''windows分区下的中文文件是乱码?''' ==<br />
如果使用了hal,应该是没有问题了,但是如果没有,请不妨试一下:<br />
在/etc/rc.conf中的daemon一段中添加hal。<br />
<br />
或者直接修改/etc/fstab,'''注意危险''',你如果不懂,就不要学我:-)。如果locale是utf8,挂载windows分区时应该做如下设置<br />
/dev/hdc5 / reiserfs defaults iocharset=utf8 0 0<br />
<br />
如果locale是GBK,则应该是<br />
iocharset=cp936 <br />
<br />
已知问题:<br />
<br />
=='''samba乱码'''==<br />
用Arch作为samba服务器时,在 /etc/samba/smb.conf 中加入下面一行就可以解决Windows客户端等乱码问题:<br />
unix charset=gb2312<br />
<br />
=='''ftp乱码'''==<br />
很多ftp站点是GBK编码,如果使用UTF8的locale,下载的文件名可能会乱码。对于lftp,在.lftp/rc下做如下设置<br />
set ftp:charset "gbk"<br />
set file:charset "UTF-8"<br />
对于gftp,可以在.gftp/gftprc中做如下设置即可正确显示服务器端gbk编码的文件名<br />
remote_charsets=gb2312<br />
但下载下来的文件名仍然是乱码,此时需要打补丁。补丁地址为:<br />
http://www.teatime.com.tw/%7Etommy/linux/gftp_remote_charsets.patch<br />
<br />
==JAVA界面乱码==<br />
对于java 1.5来说(同样适用于java 1.6),只要在<br />
/opt/java/jre/lib/fonts<br />
中建立fallback目录,然后链接或拷贝若干中文字体到该目录就能使java程序正确显示中文。例如,在已经安装 jre 和ttf-fireflysung 的情况下,执行下面的命令即可:<br />
ln -s /usr/share/fonts/TTF/odosung.ttc /opt/java/jre/lib/fonts/fallback/<br />
cd /opt/java/jre/lib/fonts/fallback/<br />
#以下两个命令要使用root权限<br />
mkfontdir<br />
mkfontscale<br />
<br />
== '''Doc文件无法打开或显示不正常?''' ==<br />
安装openoffice。<br />
pacman -S openoffice-zh_cn<br />
*如果你打算使用英文版的openoffice,你只需要安装openoffice-base包。<br />
*正体中文包 openoffice-zh_tw。<br />
*开启 amd_64 的 openoffice 时可能发生异常,此时可安装 libsndfile 进行修正。<br />
<br />
已知问题:官方库中的openoffice<br />
<br />
=='''正确显示中文PDF文件'''==<br />
<br />
=== Evince===<br />
<br />
pacman -S evince<br />
<br />
===xpdf===<br />
<br />
pacman -S xpdf-chinese-simplified<br />
<br />
===kpdf===<br />
<br />
===arcobat===<br />
安装AUR里的acroread7-chsfont即可。<br />
<br />
'''Tips:''' Evince,Xpdf,Kpdf都能正确显示大部分中文PDF文件,但是一些没有内嵌中文字体的PDF文件需要CMap文件, 文本编码, 和其他各种配置信息等才能正确显示。这些附加信息包含在xpdf-chinese-simplified中,xpdf-chinese-simplified可以不依赖Xpdf而独立安装,但是Arch 中<br />
xpdf-chinese-simplified依赖于Xpdf这个包,这个依赖性的处理不太合理,用户可以自行修改。或者给包维护者[http://bugs.archlinux.org/ 提交解决方法]<br />
<br />
==vim乱码==<br />
如果locale是utf8编码,用vim显示gbk编码的文件可能会乱码。因此需要在.virc做如下设置<br />
"Chinese GBK support<br />
set fileencodings=utf8,gbk<br />
<br />
==Latex中如何使用中文==<br />
首先需要安装CJK包,然后需要安装合适的字体。具体可以参考<br />
*http://www.ctex.org<br />
*http://www.newsmth.net 的Tex版<br />
<br />
==如何使用字典==<br />
首先请先安装stardict<br />
pacman -S stardict<br />
stardict默认是不带字典的,需要去http://stardict.sourceforge.net/ 下载字典安装。安装方法如下<br />
tar -xjvf testdict.tar.bz2<br />
mv testdict /usr/share/stardict/dic<br />
推荐使用<br />
*xdict英汉字典 <br />
*Merriam Webster 10th dictionary<br />
*牛津现代英汉双解辞典(正体中文)<br />
*朗道英汉词典(正体中文)</div>Yanghuan