Touchpad Synaptics

出自 Arch Linux 中文维基
警告: xf86-input-synaptics 已經停止維護,請儘量使用 libinput。個別情況下還是要使用 xf86-input-synaptics, 比如 [1][2]

本文描述了 Synaptics 輸入驅動 的安裝和配置過程,適用於大多數筆記本電腦上的Synaptics(或ALPS)觸摸板。

安裝[編輯 | 編輯原始碼]

安裝 軟體包 xf86-input-synaptics

配置[編輯 | 編輯原始碼]

配置的主要方法是通過修改 xorg Server 配置文件來完成配置。在安裝了 xf86-input-synaptics 之後,一個默認的配置文件位於 /usr/share/X11/xorg.conf.d/70-synaptics.conf

用戶可以將此文件複製到 /etc/X11/xorg.conf.d/然後編輯配置,完整的選項列表請參考synaptics的 synaptics(4) 手冊頁。

常用選項[編輯 | 編輯原始碼]

下面列舉了大多數用戶希望進行配置的選項。比如,下面的例子裡,我們啟用了水平,垂直和環形滾動:

/etc/X11/xorg.conf.d/70-synaptics.conf
 Section "InputClass"
       Identifier "touchpad"
       Driver "synaptics"
       MatchIsTouchpad "on"
              Option "TapButton1" "1"
              Option "TapButton2" "3"
              Option "TapButton3" "2"
              Option "VertEdgeScroll" "on"
              Option "VertTwoFingerScroll" "on"
              Option "HorizEdgeScroll" "on"
              Option "HorizTwoFingerScroll" "on"
              Option "CircularScrolling" "on"
              Option "CircScrollTrigger" "2"
              Option "EmulateTwoFingerMinZ" "40"
              Option "EmulateTwoFingerMinW" "8"
              Option "FingerLow" "30"
              Option "FingerHigh" "50"
              Option "MaxTapTime" "125"
              ...
 EndSection
TapButton1
(integer) 配置 「當用一根手指在非角落區域觸擊時,哪個滑鼠鍵點擊事件被上報」
TapButton2
(integer) 配置 「當用兩根手指在非角落區域觸擊時,哪個滑鼠鍵點擊事件被上報」
TapButton3
(integer) 配置 「當用三根手指在非角落區域觸擊時,哪個滑鼠鍵點擊事件被上報」
RBCornerButton
(integer) 配置 「當在右下角單指觸及時,哪個滑鼠鍵點擊事件被上報"(使用Option "RBCornerButton" "3"來完成Ubuntu式的右鍵點擊設定(右下角輕觸代表點擊右鍵))
RTCornerButton
(integer) 對右上角輕觸進行配置,和RBCornerButton類似
VertEdgeScroll
(boolean) 在觸摸板的由邊緣滑動時,啟用垂直滾動
HorizEdgeScroll
(boolean) 在觸摸板的下邊緣滑動時,啟用水平滾動
VertTwoFingerScroll
(boolean) 啟用雙指垂直滾動
HorizTwoFingerScroll
(boolean) 啟用雙指水平滾動
EmulateTwoFingerMinZ/W
(integer) 使用這兩個參數來對雙指滾動的精度進行調教
FingerLow
(integer) 手指壓力低於此數值時視為手指移開。
FingerHigh
(integer) 手指壓力高於此數值時視為手指按壓.
MaxTapTime
Determines how "crisp" a tap must be to be considered a real tap. Decrease the value to require a more crisp tap. Properly adjusting this parameter can reduce false positives when the hands hover over or lightly touch the pad.
VertScrollDelta and HorizScrollDelta
(integer) configures the speed of scrolling, it is a bit counter-intuitive because higher values produce greater precision and thus slower scrolling. Negative values cause natural scrolling like in OS X.

這個例子包含了所有選項的簡短介紹. 因為不同計算機的配置一般也不同. 我們推薦使用 synclient來對你的計算機進行針對性調教

如果你經常因為手掌掃過觸摸板而導致TabButton2屬性被觸發(大多數時候都是"粘貼」動作),而你又不介意關閉掉雙指觸擊功能,請將TapButton2設置為0.

Recent versions include a "Coasting" feature, enabled by default, which may have the undesired effect of continuing almost any scrolling until the next tap or click, even if you are no longer touching the touchpad. This means that to scroll just a bit, you need to scroll (by using the edge, or a multitouch option) and then almost immediately tap the touchpad, otherwise scrolling will continue forever. If wish to avoid this, set CoastingSpeed to 0.

如果觸摸板太敏感,可以使用更高的 FingerLowFingerHigh 值,FingerLow 應該比 FingerHigh 小。

實時配置[編輯 | 編輯原始碼]

除了提供傳統的配置方法,Synaptics驅動現在還支持實時配置。這意味著用戶能通過軟體來進行實時設置而不需要重啟X伺服器。在你將配置項添加到主配置文件之前,這個特性可以幫助你進行測試。

警告: 實時配置是非永久的,當重啟,掛起/恢復,或者重啟udev後就會失效。所以這個功能只適合用來對配置進行測試和精校。

命令行工具[編輯 | 編輯原始碼]

Synclient — Synclient是一個可以對Synaptics驅動進行查詢並進行配置的命令行工具,這個工具是由synaptics維護者開發並和synaptics驅動一起提供給用戶

https://xorg.freedesktop.org/ || xf86-input-synaptics

xinput — 調試設備的小型通用命令行程序

https://xorg.freedesktop.org/ || xorg-xinput

圖形化工具[編輯 | 編輯原始碼]

  • GPointing Device Settings — 提供對當前系統上的指針設備進行實時配置的圖形界面(包括Synaptics觸摸板),這個應用替代GSynaptics成為了對Synaptics驅動進行圖形化配置的優先程序.
https://wiki.gnome.org/Attic/GPointingDeviceSettings || gpointing-device-settingsAUR
注意: 需要安裝 xf86-input-synapticslibsynapticsAUR , GPointingDeviceSettings工具才能在Synaptics觸摸板上運行!
  • kcm-touchpad — 在KDE的一個新的觸摸板配置工具,提供了一個在「系統設置」中的模塊。在2014年2月發布,工作於KDE SC 4.12+。這將被作為一個 synaptikskcm_touchpad 的替代品。
https://invent.kde.org/plasma/plasma-desktop/-/tree/master/kcms/touchpad || plasma-desktop

其他選項[編輯 | 編輯原始碼]

VertScrollDelta and HorizScrollDelta
(integer)配置滾動速度, 對它們的配置比較直觀,因為值越高滾動精度就越高而速度越低.設置成負值就能實現類似OS X系統的"自然滾動"
SHMConfig
(boolean) 是否開啟共享內存以支持實時調試. 現在這個選項已經無效,並且它也只能提供針對事件的實時調試

Xfce4/Cinnamon[編輯 | 編輯原始碼]

當在XFCE 4下想要修改這些設定時:

  1. 打開 System Settings.
  2. 點擊 Mouse and Touchpad.
  3. Touchpad 選項卡裡對這些配置進行更改.

To change these settings in Cinnamon:

  1. Open Cinnamon System Settings.
  2. Click Mouse and Touchpad.
  3. Change the settings on the Touchpad tab.

MATE[編輯 | 編輯原始碼]

在MATE上,可以通過下面方法配置觸摸板:

  1. 運行 dconf-editor
  2. 編輯 org.mate.desktop.peripherals.touchpad 文件夾裡面的鍵

可以通過下面的方法來阻止Mate配置守護程序改寫當前配置:

  1. 運行 dconf-editor
  2. 編輯 org.mate.SettingsDaemon.plugins.mouse
  3. 取消active勾選 .

高級配置[編輯 | 編輯原始碼]

使用xinput來檢測您的觸摸板有什麼功能[編輯 | 編輯原始碼]

根據型號不同,Synaptics可能有以下特性:

  • 擁有物理左鍵,物理中鍵,物理右鍵
  • 能夠進行兩指檢測
  • 能夠進行三指檢測
  • 能夠配置解析度

使用 xinput list來找到您的synaptics設備名

首先,找到觸摸板的名字

$ xinput -list

然後,您可以使用xinput(1)來查看您的觸摸板有什麼特性

$ xinput list-props "SynPS/2 Synaptics TouchPad" | grep Capabilities

      Synaptics Capabillities (309):  1, 0, 1, 0, 0, 1, 1

從左到右,分別代表:

  • (1) 設備有物理左鍵
  • (0) 設備有物理中鍵
  • (1) 設備有物理右鍵
  • (0) 設備支持兩指檢測
  • (0) 設備支持三指檢測
  • (1) 設備可以配置垂直解析度
  • (1) 設備可以配置水平解析度

使用xinput list-props "SynPS/2 Synaptics TouchPad" 來列出設備的所有屬性

詳情請閱讀xinput和synaptics的幫助文檔

Synclient[編輯 | 編輯原始碼]

在synaptics manpage裡面列出的所有參數都可以通過synclient進行配置.下面命令列出了一個完整的用戶設置的清單:

$ synclient -l

所有列出的參數都可以用synclient進行配置, 比如:

$ synclient PalmDetect=1 (to enable palm detection)
$ synclient TapButton1=1 (configure button events)
$ synclient TouchpadOff=1 (disable the touchpad)

使用synclient進行成功的設定和測試後,你可以將這些設定添加到/etc/X11/xorg.conf.d/10-synaptics.conf

本文內容或本節內容已經過期。

原因:

1.71驅動裡,已經取消了SHMConfig設定,隨驅動一起發行的synclient工具也不再支持-m參數.所以,下面的描述已經過期.本文的英文版裡面已經刪除了使用synclient -m進行測試的這一節.考慮到兼容性,我保留了這一段描述

(在Talk:Touchpad Synaptics討論)

synclient監視器可以實時地顯示觸摸板的觸摸位置和壓力,以提供比默認的Synaptics設置更精細的調整。您需要設置SHMConfig選項為ontrue以確保synclient正常工作。

您可以這樣啟動synclient:

$ synclient -m 100

-m參數設置了synclient的更新間隔時間,單位為毫秒。

這個監視器提供了有關於觸摸板當前狀態的信息。比如,如果您利用觸摸板移動了滑鼠指針,那麼監視器中x和y的值就會隨之變化。這樣您就可以方便地確定各個邊界,以便於設定LeftEdge-,RightEdge-,BottomEdge-和TopEdge-選項。

下面列出了所有能夠監視的狀態以及它們的簡要描述:

+監視項+ +描述+
time 從開始記錄起到當前經過的時間,單位是秒。
x, y 手指放在觸摸板上的x/y坐標,原點是左上角。
z 手指放在觸摸板上的壓力。
f 放在觸摸板上的手指數。
w 手指的寬度。
l,r,u,d,m,multi 這些值代表了左,右,上,下,中,多功能這6個按鍵的狀態,0代表沒有被按下,1代表被按下。
gl,gm,gr 對於有guest device的觸摸板,這些值代表了guest device上按鍵的狀態。
gdx, gdy guest device的x/y坐標。

如果某個值一直是0,那就表明您的觸摸板不支持這一項。

可以利用synclient來測試新的值(首先要確保SHMConfig被打開)。例如,要調整最小指針速度:

$ synclient MinSpeed=0.5

這樣做出的改變不是永久的。如果您對這些更改滿意並希望它們一直保留,就需要把他們放到 /etc/X11/xorg.conf.d/10-synaptics.conf 中。 }}

Evtest[編輯 | 編輯原始碼]

evtest工具能夠實時的顯示觸摸板上的壓力和位置信息,允許對默認的Synaptics設定進行精校.可以通過如下方式啟動evtest

$ evtest /dev/input/eventX

X代表觸摸板的ID,可以通過查看cat /proc/bus/input/devices的輸出來獲取它. evtest需要對設備進行排他訪問,因此,evtest不能和X Server的實例共存.你可以通過殺死X Server進程或者在虛擬終端上運行evtest來解決這個問題(例如,通過CTRL+ALT+2來切換到2號虛擬終端)

xev[編輯 | 編輯原始碼]

工具 xorg-xev 可以實時顯示按壓、點擊、壓力、位置和其它檢測到的數據,可以更深入的優化 Synaptics 設置。xev 可以通過 "-event" 參數設置報告的事件。

環狀滾動[編輯 | 編輯原始碼]

Synaptics提供和ipod觸控方式類似的環狀滾動功能。您可以在觸摸板上畫圈,來代替在邊緣上垂直或水平地滑動。有些用戶發現這樣滾動的更快也更精確.

添加下面幾行到/etc/X11/xorg.conf.d/70-synaptics.conf中以啟用環狀滾動:

/etc/X11/xorg.conf.d/70-synaptics.conf
 Section "InputDevice"
         ...
         Option      "CircularScrolling"          "on"
         Option      "CircScrollTrigger"          "0"
         ...
 EndSection

選項CircScrollTrigger可以設置為下面的值之一,它能夠決定環狀滾動應該從哪個邊緣開始:

0    所有边缘
1    顶部边缘
2    右上角
3    右边缘
4    右下角
5    底部边缘
6    左下角
7    左边缘
8    左上角

設置一個非0值對於同時使用水平/垂直滾動和環狀滾動的用戶非常有用.設定後,會根據你開始的邊緣決定到底使用哪種滾動.

如果您想要快速滾動,請在觸摸板中部畫小圈,相反,如果您想要慢速地且更精確地滾動,請畫大圈。

自然滾動(觸控螢幕式滾動)[編輯 | 編輯原始碼]

可以在synaptics上啟用自然滾動(觸控螢幕那種滾動).只要將VertScrollDeltaHorizScrollDelta的值設定為負就行(翻轉滾動方向):

/etc/X11/xorg.conf.d/70-synaptics.conf
Section "InputClass"
    ...
    Option      "VertScrollDelta"          "-111"
    Option      "HorizScrollDelta"         "-111"
    ...
EndSection

軟開關[編輯 | 編輯原始碼]

有一個能啟用禁用觸摸板的軟開關會方便許多,可以用 xinput 腳本綁定到鍵盤事件,詳情參考 Extra keyboard keys in Xorg

/usr/local/bin/touchpad_toggle.sh
#!/bin/bash

declare -i ID
ID=`xinput list | grep -Eio '(touchpad|glidepoint)\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}'`
declare -i STATE
STATE=`xinput list-props $ID|grep 'Device Enabled'|awk '{print $4}'`
if [ $STATE -eq 1 ]
then
    xinput disable $ID
    # echo "Touchpad disabled."
    # notify-send 'Touchpad' 'Disabled' -i /usr/share/icons/Adwaita/48x48/devices/input-touchpad.png
else
    xinput enable $ID
    # echo "Touchpad enabled."
    # notify-send 'Touchpad' 'Enabled' -i /usr/share/icons/Adwaita/48x48/devices/input-touchpad.png
fi
提示:使用 bumblebee 下的外置顯示時,可以通過在命令中加入 DISPLAY=:8 設置第二個 X Server.

此外可以使用 synclient 切換 touchpad. 這個方式僅能禁用觸摸事件,無法禁用物理按鍵的使用:

/sbin/trackpad-toggle.sh
 #!/bin/bash
 
 synclient TouchpadOff=$(synclient -l | grep -c 'TouchpadOff.*=.*0')

在打字時禁用觸摸板[編輯 | 編輯原始碼]

使用驅動的掌壓感應[編輯 | 編輯原始碼]

首先,你需要測試您的觸摸板是否支持掌壓感應,如果支持,需要測試設定是否精確:

$ synclient PalmDetect=1

試著打字,通過如下方式調整感應精度,PalmMinWidth 用來設定接觸面的最小值

$ synclient PalmMinWidth=8

PalmMinZ用來設定在什麼壓力下會啟動掌壓感應

$ synclient PalmMinZ=100
提示:可以使用 evtest 查看 touchpad 使用時的寬度和 Z 值.

當你找到了合適的設定後,將它們加入 /etc/X11/xorg.conf.d/70-synaptics.conf中.

Option "PalmDetect" "1"
Option "PalmMinWidth" "8"
Option "PalmMinZ" "200"
警告: For some touchpads, an issue with the kernel can cause the palm width to always be reported as 0. This breaks palm detection in a majority of cases. Pending an actual fix, you can patch the synaptics package to use only Z for palm detection.
提示:If you experience problems with consistent palm detection for your hardware, an alternative to try is libinput.

使用 syndaemon[編輯 | 編輯原始碼]

syndaemon(1) 可以監控鍵盤活動並在打字時禁用觸摸板,有多個選項可以控制禁用條件。可以通過下面命令查看幫助:

$ syndaemon -?

例如要在打字 0.5 秒後禁用點擊和滾動,忽略 Ctrl 等修飾鍵,使用

$ syndaemon -i 0.5 -t -K -R

確定好需要的選項後,在登錄管理器或 xinitrc 中配置為隨 X 啟動,使用 -d 選項程序會在後台運行。

檢測到滑鼠後禁用觸摸板[編輯 | 編輯原始碼]

udev的協助下,可以實現當外置滑鼠插入後自動禁用觸摸板的功能。可以使用下面規則:

基本桌面[編輯 | 編輯原始碼]

非桌面環境可以使用下面通用規則:

/etc/udev/rules.d/01-touchpad.rules
SUBSYSTEM=="input", KERNEL=="mouse[0-9]*", ACTION=="add", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/username/.Xauthority", RUN+="/usr/bin/synclient TouchpadOff=1"
SUBSYSTEM=="input", KERNEL=="mouse[0-9]*", ACTION=="remove", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/username/.Xauthority", RUN+="/usr/bin/synclient TouchpadOff=0"

If the touchpad is always deactivated at startup, even when no mouse is plugged in, try adding the following criteria between the KERNEL and ACTION parameters above:

ATTRS{name}!="*TouchPad", ATTRS{name}!="*Stick",

GDM[編輯 | 編輯原始碼]

本文內容或本節內容已經過期。

原因: GDM stores the Xauthority files in /run/user/uid/gdm/Xauthority. (在Talk:Touchpad Synaptics討論)

GDM usually stores the Xauthority files inin a randomly-named directory. You should find your actual path to the Xauthority file which can be done using ps ax. For some reason multiple authority files may appear for a user, so a rule like will be necessary:

GDM 將 Xauthority 文件存放在 /var/run/gdm 下隨機命名的文件夾中. ps ax 可以查到 Xauthority 文件的位置,udev規則一般是這樣的:

ACTION=="add", KERNEL=="mouse[0-9]", SUBSYSTEM=="input", PROGRAM="/usr/bin/find /var/run/gdm -name *username* -print -quit", ENV{DISPLAY}=":0.0", ENV{XAUTHORITY}="$result/database", RUN+="/usr/bin/synclient TouchpadOff=1"
ACTION=="remove", KERNEL=="mouse[0-9]", SUBSYSTEM=="input", PROGRAM="/usr/bin/find /var/run/gdm -name *username* -print -quit", ENV{DISPLAY}=":0.0", ENV{XAUTHORITY}="$result/database", RUN+="/usr/bin/synclient TouchpadOff=0"

Furthermore, you should validate that your udev script is running properly! You can check for the conditions using udevadm monitor -p which must be run as root.

With syndaemon running[編輯 | 編輯原始碼]

syndaemon whether started by the user or the desktop environment can conflict with synclient and will need to be disabled. A rule like this will be needed:

/etc/udev/rules.d/01-touchpad.rules
SUBSYSTEM=="input", KERNEL=="mouse[0-9]", ACTION=="add", PROGRAM="/usr/bin/find /var/run/gdm -name username -print -quit", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="$result/database", RUN+="/bin/sh -c '/usr/bin/synclient TouchpadOff=1 ; sleep 1; /bin/killall syndaemon; '"
touchpad-state[編輯 | 編輯原始碼]

An AUR package touchpad-state-gitAUR has been created around the udev rules above. It includes a udev rule and script:

touchpad-state [--off] [--on]

GNOME[編輯 | 編輯原始碼]

GNOME users can install GNOME shell extension Touchpad Indicator, change "Switch Method" to "Synclient" and enable "Automatically switch Touchpad On/Off" in its preferences.

KDE[編輯 | 編輯原始碼]

If using Plasma, the package plasma-desktop can be used to manage the touchpad.

System with multiple X sessions[編輯 | 編輯原始碼]

本文或本章節的事實準確性存在爭議。

原因: Hard-coded DISPLAY variable does not work with multiple X sessions.(在 Talk:Touchpad Synaptics 中討論)


For an environment where multiple users are present, a slightly different approach is needed to detect the current users X environment. This script will help achieving this:

/usr/bin/mouse-pnp-event-handler.sh
#!/bin/sh
## $1 = "add" / "remove"
## $2 = %k from udev 

## Set TRACKPAD_NAME according to your configuration. 
## Check your trackpad name with: 
## find /sys/class/input/ -name mouse* -exec udevadm info -a {} \; | grep 'ATTRS{name}'
TRACKPAD_NAME="SynPS/2 Synaptics TouchPad"

USERLIST=$(w -h | cut -d' ' -f1 | sort | uniq)
MOUSELIST=$(find /sys/class/input/ -name mouse*)

for CUR_USER in ${USERLIST}; do
         CUR_USER_XAUTH="$(sudo -Hiu ${CUR_USER} env | grep -e "^HOME=" | cut -d'=' -f2)/.Xauthority"

  
        ## Can't find a way to get another users DISPLAY variable from an isolated root environment. Have to set it manually.
        #CUR_USER_DISPL="$(sudo -Hiu ${CUR_USER} env | grep -e "^DISPLAY=" | cut -d'=' -f2)"
        CUR_USER_DISPL=":0"

        export XAUTHORITY="${CUR_USER_XAUTH}"
        export DISPLAY="${CUR_USER_DISPL}"

        if [ -f "${CUR_USER_XAUTH}" ]; then
                case "$1" in
                        "add")
                                /usr/bin/synclient TouchpadOff=1
                                /usr/bin/logger "USB mouse plugged. Disabling touchpad for $CUR_USER. ($XAUTHORITY - $DISPLAY)"
                        ;;
                        "remove")
                                ## Only execute synclient if there are no external USB mice connected to the system.
                                EXT_MOUSE_FOUND="0"
                                for CUR_MOUSE in ${MOUSELIST}; do
                                        if [ "$(cat ${CUR_MOUSE}/device/name)" != "${TRACKPAD_NAME}" ]; then
                                                EXT_MOUSE_FOUND="1"
                                        fi
                                done
                                if [ "${EXT_MOUSE_FOUND}" == "0" ]; then
                                        /usr/bin/synclient TouchpadOff=0
                                        /usr/bin/logger "No additional external mice found. Enabling touchpad for $CUR_USER."
                                else
                                        logger "Additional external mice found. Won't enable touchpad yet for $CUR_USER."
                                fi
                        ;;
                esac
        fi
done

Update the TRACKPAD_NAME variable for your system configuration. Run find /sys/class/input/ -name mouse* -exec udevadm info -a {} \; | grep 'ATTRS{name}' to get a list of useful mice-names. Choose the one for your trackpad.

Then have udev run this script when USB mices are plugged in or out, with these udev rules:

/etc/udev/rules.d/01-touchpad.rules
SUBSYSTEM=="input", KERNEL=="mouse[0-9]*", ACTION=="add", RUN+="/usr/bin/mouse-pnp-event-handler.sh add %k"
SUBSYSTEM=="input", KERNEL=="mouse[0-9]*", ACTION=="remove", RUN+="/usr/bin/mouse-pnp-event-handler.sh remove %k"

一體化觸摸板 (也被稱為 ClickPads)[編輯 | 編輯原始碼]

一些筆記本使用按鍵與觸摸板面一體的觸摸板.比如HP 4500系列筆記本,ThinkPad X220,X1 系列筆記本.默認情況下所有按鍵都被識別為左鍵,這樣就不能使用右鍵中鍵,Click-Drag手勢等功能. 在synaptics 1.6.0版驅動之前,一般使用第三方補丁來支持此類設備.但從1.6.0開始,Synaptics使用mtdev庫實現了對多點觸控的原生支持. 請注意,儘管支持多點觸控,但是Synaptics驅動不會識別是不是不同的手指(至少到1.7.1都是這樣),這樣的話,當使用物理按鍵或者拖放手勢時會有一些奇怪的現象出現.xf86-input-mtrack驅動對多點觸控有更好的支持.

可以修改/etc/X11/xorg.conf.d/50-synaptics.conf來啟用其他按鍵(或者給自定義的synaptics配置文件賦一個更高的優先級(前綴號更高),比如55-synaptics.conf):

/etc/X11/xorg.conf.d/50-synaptics.conf
...
Option "ClickPad"         "true"
Option "EmulateMidButtonTime" "0"
Option "SoftButtonAreas"  "50% 0 82% 0 0 0 0 0"
...

這三個選項是開啟其他按鍵的關鍵,第一個啟用多點觸控,第二個關閉中鍵模擬(ClickPad不支持),第三個定義軟按鍵區域

SoftButtonAreas選項的格式是(請參考synaptics(4)):

RightButtonAreaLeft RightButtonAreaRight RightButtonAreaTop RightButtonAreaBottom  MiddleButtonAreaLeft MiddleButtonAreaRight MiddleButtonAreaTop MiddleButtonAreaBottom

上面的例子一般在synaptics驅動包提供的文檔中都能找到,它將觸摸板的X坐標50%以右,Y坐標82%以下區域定義為右鍵.這裡沒有中鍵的定義,.定義的時候請注意:

将边缘设置为0代表将边缘设置到当前方向的无限远处.

下面的例子將右鍵定義為X坐標60%以右,Y坐標82%以下;X坐標40%以右,59%以左,Y坐標82%以下被定義為中鍵

...
Option     "SoftButtonAreas"  "60% 0 82% 0 40% 59% 82% 0"
...

可以使用synclient來檢查新的軟按鍵區域設置:

$ synclient -l | grep -i ButtonArea
        RightButtonAreaLeft     = 3914
        RightButtonAreaRight    = 0
        RightButtonAreaTop      = 3918
        RightButtonAreaBottom   = 0
        MiddleButtonAreaLeft    = 3100
        MiddleButtonAreaRight   = 3873
        MiddleButtonAreaTop     = 3918
        MiddleButtonAreaBottom  = 0

如果發現上述設定失效,請確認是否有其他設置覆蓋了您的設置(比如,一些AUR包給其配置檔賦予了很高的優先級)

Bottom edge correction[編輯 | 編輯原始碼]

In some cases, for example Toshiba Satellite P50, everything work out of the box except often your click are seen as mouse movement and the cursor will jump away just before registering the click. This can be easily solved running

$ synclient -l | grep BottomEdge

take the BottomEdge value and subtract a the wanted height of your button, then temporary apply with

$ synclient AreaBottomEdge=4000

when a good value has been found make it a fixed correction with

/etc/X11/xorg.conf.d/70-synaptics.conf
...
Option "AreaBottomEdge"         "4000"
...
注意: The area will not act as touchpad if the touch begins in that area, but it can still be used if the touch has originated outside.

疑難解答[編輯 | 編輯原始碼]

在從掛起/休眠恢復後觸摸板不工作[編輯 | 編輯原始碼]

Occasionally touchpads will fail to work when the computer resumes from sleep or hibernation. This can often be corrected without rebooting by

  • Switching to a console and back again,
  • entering sleep mode again, and resuming again, or
  • locating the correct kernel module, then removing it and inserting it again, possibly with a specific parameter (e.g. modprobe -r psmouse && modprobe -r psmouse proto=imps),
  • blacklisting kernel module psmouse may be a permanent option (when the touchpad is handled by another module, e.g. i2c_designware_platform),
  • adding the psmouse.synaptics_intertouch=0 kernel parameter solves the issue permanently.
注意: You can use Ctrl+Alt+F1 through F8 to switch to a console without using the mouse.

如果您使用的是筆記本電腦,在合上筆記本電腦蓋子後再次打開之後遇到這個問題,可以修改您的電源管理策略,將合上蓋子的行為改為「關閉屏幕」,而不是」掛起「或者」休眠「

xorg.conf.d/70-synaptics.conf在 MATE 上失效[編輯 | 編輯原始碼]

MATE 會覆蓋您的個性化設定,包括那些沒法在 MATE 下進行圖形化設定的選項.這會導致/etc/X11/xorg.conf.d/70-synaptics.conf 裡的設置不起作用了.請參考本文MATE 一節來避免這種情況的發生.

觸摸板無法工作, Xorg.0.log 中顯示 "Query no Synaptics: 6003C8"[編輯 | 編輯原始碼]

一般這是因為在系統上設置synaptics的方法不對:同時載入了兩個synaptics模塊.我們可以通過查看xorg log(/var/log/Xorg.0.log)來識別這種情況:

/var/log/Xorg.0.log
 [ 9304.803] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "evdev touchpad catchall"
 [ 9304.803] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "touchpad catchall"

這裡可以看到兩個不同的模塊被載入了.在某些情況下,這會導致觸摸板不可用.

我們可以通過將 MatchDevicePath "/dev/input/event*" 添加到 /etc/X11/xorg.conf.d/10-synaptics.conf 中來防止這種雙重載入:

/etc/X11/xorg.conf.d/10-synaptics.conf
 Section "InputClass"
       Identifier "touchpad catchall"
       Driver "synaptics"
       MatchIsTouchpad "on"
       MatchDevicePath "/dev/input/event*"
             Option "TapButton1" "1"
             Option "TapButton2" "2"
             Option "TapButton3" "3"
 EndSection 

重啟X Server,檢查Xorg.0.log,這個錯誤應該會消失,觸摸板也應該可用了

相關bug報告:FS#20830

相關論壇主題:

觸摸板被識別為"PS/2 Generic Mouse" 或者 "Logitech PS/2 mouse"[編輯 | 編輯原始碼]

Laptops with touchscreen & touchpad[編輯 | 編輯原始碼]

There also seems to be a problem with laptops which have both a touchscreen & a touchpad, such as the Dell XPS 12 or Dell XPS 13. To fix this, you can blacklist the i2c_hid driver, this does have the side-effect of disabling the touchscreen though.

This seems to be a known problem. Also see this thread.

Post kernel 3.15, having the module blacklisted may cause touchpad to stop working completely. Removing the blacklist should allow this to start working with limited functionality, see FS#40921.

Synaptics觸摸板某些功能失效 (比如觸擊,滾動)[編輯 | 編輯原始碼]

有些時候Synaptics觸摸板會失去某些功能.即使正確配置了也不能使用諸如雙指滾動,雙指觸發中鍵點擊等功能.這個問題可能和上面提到的

如果阻止了重複加載模塊後還有問題,可以嘗試將"MatchIsTouchPad"配置項注釋掉(這個選項synaptics默認開啟)

If clicking with either 2 or 3 fingers is interpreted as a right-click, so you cannot get a middle click either way regardless of configuration, this bug is probably the culprit: https://bugs.freedesktop.org/show_bug.cgi?id=55365

在一些筆記本的Elantech touchpads觸摸板多點觸控失效[編輯 | 編輯原始碼]

在內核啟動選項加上"i8042.reset i8042.nomux=1 i8042.nopnp i8042.noloop"等. 在我的聯想小新筆記本上我增加了"i8042.reset i8042.nomux=1"兩個選項,觸摸板正常識別,多點觸控可用。

指針跳躍[編輯 | 編輯原始碼]

某些用戶會發現滑鼠指針奇怪地在屏幕上「跳躍」,當前沒有有效的辦法來解決這個問題,但是有開發者正在關注這個BUG.

另一個可能是你遇到了和i8042控制器有關的IRQ losses問題(很多筆記本用這個i8042來控制鍵盤,觸摸板).你有兩個選擇: 1.重新加載psmouse模組(rmmod&&insmod) 2.將i8042.nomux=1加入到啟動行裡,然後重啟電腦

/dev/input/*中沒有觸摸板設備}[編輯 | 編輯原始碼]

如果出現這種情況,您可以利用這條命令來顯示您的輸入設備信息:

$ cat /proc/bus/input/devices

找尋一個名字為"SynPS/2 Synaptics TouchPad"的輸入設備。"Handlers"一節就是觸摸板設備的正確位置。

樣例輸出

$ cat /proc/bus/input/devices
 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

在這個例子中 Handlersmouse0event1,所以應該使用 /dev/input/mouse0 作為觸摸板設備的位置。

這篇文章的某些內容需要擴充。

原因: TODO: 解釋怎麼將這點反映到/etc/X11/xorg.conf.d/10-synaptics.conf中 (在 Talk:Touchpad Synaptics 中討論)

Firefox和特殊觸摸板事件[編輯 | 編輯原始碼]

本文或本章節的事實準確性存在爭議。

原因: 至少在我的FireFox version 23.01上面,沒有這些設置而且默認設定工作的很好(在 Talk:Touchpad Synaptics 中討論)

默認的,firefox會設置觸摸板上特殊區域完成特殊功能。你可以在地址欄輸入about:config設置這些功能。編輯就是雙擊這些行,讓true變成false,如果是數值你就必須手動改變了。

Firefox 17.0 and later[編輯 | 編輯原始碼]

Horizontal scrolling will now by default scroll through pages and not through your history. To reenable Mac-style forward/backward with two-finger swiping, edit:

mousewheel.default.action.override_x = 2

You may encounter accidental forwards/backwards while scrolling vertically. To change Firefox's sensitivity to horizontal swipes, edit:

mousewheel.default.delta_multiplier_x

The optimum value will depend on your touchpad and how you use it, try starting with 10. A negative value will reverse the swipe directions.

Opera:水平滾動問題[編輯 | 編輯原始碼]

點擊工具 -> 首選項 -> 高級 -> 快捷方式,在這裡選擇 "Opera Standard" 滑鼠屬性,點擊「編輯」,在「應用程式」部分:

本文或本章節的事實準確性存在爭議。

原因: 這裡的描述不是很清晰,請使用Opera的朋友確認以後進行修正(在 Talk:Touchpad Synaptics 中討論)
  • 將 "Button 6" 鍵賦值給命令 "Scroll left"
  • 將 "Button 7" 鍵賦值給命令 "Scroll right"

在LG筆記本上的滾動和多功能[編輯 | 編輯原始碼]

這些問題可能出現在多種型號的LG筆記本上。 症狀包括:當按下滑鼠鍵1時snaptics誤認為同時有ScrollUP操作和一個滑鼠鍵1按下;滑鼠鍵2的情況類似.

滾動問題可以通過添加下面一行到xorg.conf中:

/etc/X11/xorg.conf.d/xorg.conf
Option "UpDownScrolling" "0"

注意這會讓synaptics對其它鍵的響應出錯。有一個Oskar Sandberg寫的補丁[3] 能夠解決這個問題。

但是不能為最新版的synaptics驅動打上面的補丁,編譯會出錯。您可以用GIT包來安裝synaptics[4]

To build the package after downloading the tarball and unpacking it, execute:

$ cd synaptics-git
$ makepkg

外置滑鼠的其他問題[編輯 | 編輯原始碼]

首先,你需要確定你的外部滑鼠描述設置裡面包含(或者類似)這一行:

/etc/X11/xorg.conf.d/xorg.conf
Option     "Device" "/dev/input/mice"

如果"Device"行不一樣,改成如上的,並且重新啟動X。如果沒有解決,修改"Server Layout"設置,將touchpad設置為 CorePointer:

/etc/X11/xorg.conf.d/xorg.conf
InputDevice    "Touchpad" "CorePointer"

將你的外接滑鼠設置為"SendCoreEvents":

/etc/X11/xorg.conf.d/xorg.conf
InputDevice    "USB Mouse" "SendCoreEvents"

最後,將這個添加到你的外接滑鼠設置裡面去:

/etc/X11/xorg.conf.d/xorg.conf
Option      "SendCoreEvents"    "true"

如果還是不行,說不定是滑鼠硬體有問題。請檢查是不是bug,或者查看論壇,看是否有人有更好的解決方法。

觸摸板的同步問題[編輯 | 編輯原始碼]

有些時候指針會沒有原因地「卡住」幾秒或隨機亂動。可以在/var/log/messages.log中看到出現了如下提示:

/var/log/messages.log
psmouse.c: TouchPad at isa0060/serio1/input0 lost synchronization, throwing 3 bytes away

這個問題沒有一個通用的解決辦法,但是您可以嘗試以下的方法:

  • 如果您使用CPU頻率調節,不要使用"ondemand"模式而是"performance"模式 ,因為觸摸板可能會在cpu頻率變化時失去同步。
  • 嘗試不要使用ACPI電池監視器。
  • 嘗試用"proto=imps"選項載入pmouse模塊,添加下面一行到/etc/modprobe.d/modprobe.conf
/etc/modprobe.d/modprobe.conf
options psmouse proto=imps
  • 嘗試其它桌面環境。據某些用戶報告,這個問題僅在使用Xfce,GNOME時才出現,不知道什麼原因。

觸擊與按鍵點擊之間出現延遲[編輯 | 編輯原始碼]

如果出現了這種情況,建議啟用FastTaps

本文內容或本節內容已經過期。

原因:

1.7.1版本的synaptics驅動裡,已經移除了FastTaps選項

(在Talk:Touchpad Synaptics討論)

Option "FastTaps" "1" 添加到/etc/X11/xorg.conf.d/10-synaptics.conf 中:

/etc/X11/xorg.conf.d/10-synaptics.conf
 Section "InputClass"
      Identifier "Synaptics Touchpad"
      Driver "synaptics"
      ...
      Option "FastTaps" "1"
      ...
 EndSection

出現錯誤:SynPS/2 Synaptics TouchPad cannot grab event device, errno=16[編輯 | 編輯原始碼]

如果你使用Xorg 7.4,查看Xorg日誌(/var/log/Xorg.0.log)時候可能會發現有這麼一條警告信息。這是因為當使用linux2.6事件協議,驅動默認會試圖獨占此設備。失敗就會出現此條提示。也就是說其他無論是內核空間還是用戶空間的程序都無法獲取此設備上的信號。當你的xorg.conf裡面還定義了一個/dev/misc輸入設備時候,這點很有用。但是如果你想測試設備的信號,那麼就很麻煩了。

開啟和關閉這項功能,可以修改你定義的xorg.conf的觸摸板部分:

Section "InputDevice"
       ...
       Option "GrabEventDevice" "boolean"
       ...
EndSection

boolean部分可以是yes或者false,分別代表啟用和禁止此功能。

當然你也可以使用synclient來調整,不過不能馬上生效,只有觸摸板驅動被禁用然後重新啟用才能有效果。你可以通過切換到控制台然後切換回X來實現。

從Windows系統重啟後觸摸板失去多點觸控的能力[編輯 | 編輯原始碼]

許多驅動都會在電腦啟動時將固件載入到內存中.這些固件信息在重啟後不一定會被清除,而且有可能和Linux下的驅動不兼容.唯一清除內存中此類信息的方法就是用關機取代重啟.在實踐中,一般認為不同作業系統的切換最好不要用重啟來進行.

Touchpad not recognized after shutdown from Arch[編輯 | 編輯原始碼]

Certain touchpads (elantech in particular) will fail to be recognized as a device of any sort after a standard shutdown from Arch linux. There are multiple possible solutions to this problem:

  • Boot into a Windows partition/install disk and shutdown from there.
  • Wait approximately 1 minute before turning on the computer after shutdown.
  • As discussed in https://bugzilla.kernel.org/show_bug.cgi?id=81331#c186 a patch has been merged into the stable kernel that provides a fix for Elantech touchpads. Gigabyte P34, P35v2 and X3 models are supported by default, for others (especially rebranded Gigabyte laptops, like XMG's) i8042.kbdreset=1 can be set as kernel parameter.

Trackpoint and Clickpad[編輯 | 編輯原始碼]

Newer Thinkpads do not have physical buttons for their Trackpoint anymore and instead use the upper area of the Clickpad for buttons (Left, Middle, Right). Apart from the ergonomic viewpoint this works quite well with current Xorg. Unfortunately mouse wheel emulation using the middle button is not supported yet. Install xf86-input-evdev-trackpointAUR from the AUR for a patched and properly configured version if you intend to use the Trackpoint.

參閱[編輯 | 編輯原始碼]