Synaptics Touchpad

From Gentoo-en
Jump to: navigation, search
Please format this article according to the Style Guidelines and Wikification suggestions, then remove this notice {{Wikify}} from the article.

Reason(s): Clean up to the original article

Introduction

This guide describes setting up Synaptics and ALPS touchpads under Linux 2.6.X and 3.0.X It assumes basic linux knowledge (Kernel installation related tasks, basic editing of xorg.conf).

Note: If you're using Xorg 7.3 (>=xorg-server-1.4 <xorg-server-1.9.2) with HAL support enabled, see Synaptics_Touchpad/Xorg_7.3.

This is not strictly necessary for normal mouse configuration, which can be achieved with the normal X11 mouse configuration. The synaptics driver enables the following functionality:

  1. Movement with adjustable, non-linear
  2. Button events through tapping (Click and Double Click).
  3. Dragging.
  4. Middle and right button events on the upper and lower corners.
  5. Vertical scrolling (button four and five events) through moving the finger on the right side.
  6. The up/down button sends button four/five events.
  7. Horizontal scrolling (button six and seven events) through moving the finger on the lower side.
  8. The multi-buttons send button four/five events, and six/seven events for horizontal scrolling.
  9. Adjustable finger detection.
  10. Multifinger taps: two finger for middle button and three finger for right button (Requires hardware support).
  11. Run-time configuration. This means you can change parameter settings without restarting the X server.

Installation

Kernel Settings

Ensure you have a recent enough kernel:

  • True Touchpad: Kernel >=2.6.1
  • ALPS: Kernel >=2.6.11
Linux Kernel Configuration: Enable Synaptics Support
Device Drivers --->
  Input Device Support --->
      <*> Event Interface
      [*] Mice --->
          <*> PS/2 mouse

Apple users may also need to add:

Linux Kernel Configuration: Enable Synaptics Support (Apple Users)
Device Drivers --->
  Input Device Support --->
      <*> Event Interface
      [*] Mice --->
         <*> Apple USB Touchpad support

Applications

Add "synaptics" to the INPUT_DEVICES variable in /etc/make.conf. Example:

File: make.conf
INPUT_DEVICES="evdev keyboard mouse synaptics"

If you already installed Xorg then only emerge the synaptics driver: emerge -1 x11-drivers/xf86-input-synaptics

If you didn't install Xorg yet, the driver will be added when you do. The driver includes a command line utility (synclient) to control the touchpad. Graphical utilities are also available (kde-misc/synaptiks ksynaptics, gsynaptics).

Touchpad device file

If X.Org fails to automatically detect the touchpad, its device file will have to be entered manually. To find the touchpad's device file use:
cat /proc/bus/input/devices

Look for your device (synaptics or ALPS) in the list. The device file name will be on the Handlers Line below it. If there is more than one listed, it is the first one.

Code: Example section from /proc/bus/input/devices
   I:  Bus=0011 Vendor=0002 Product=0008 Version=7322
   N:  Name="AlpsPS/2 ALPS GlidePoint"
   P:  Phys=isa0060/serio1/input0
   H:  Handlers=mouse1 event2
   B:  EV=f
   B:  KEY=420 0 670000 0 0 0 0 0 0 0 0
   B:  REL=3
   B:  ABS=1000003
As a basic test, run:
cat /dev/input/mouse1
(with the appropriate device file) and interact with the touchpad. If there is no output at all, either the device file is the wrong one, or the kernel driver isn't loaded.

X.Org

Automatic Configuration

This guide assumes you have an otherwise working xorg.conf file. The automatic configuration settings are the same for both synaptics and ALPS devices. The following sections need to be modified:

File: xorg.conf - ServerLayout Section
InputDevice "TouchPad" "CorePointer"

If you use a mouse in parallel, you should only have one "CorePointer". For the other device put "SendCoreEvents". Add an input device section for the touchpad:

File: xorg.conf - New InputDevice Section
 Section "InputDevice"
    Driver         "synaptics"
    Identifier "TouchPad"
    Option         "SendCoreEvents"
    Option         "Protocol" "auto-dev"
    Option         "SHMConfig" "on"
 EndSection

Manual Configuration

Synaptics

File: xorg.conf - Synaptics InputDevice Section
 Section "InputDevice"
    Driver         "synaptics"
    Identifier "TouchPad"
    Option         "SendCoreEvents"
    Option         "Protocol" "auto-dev"
    Option         "SHMConfig" "on"
 EndSection

ALPS

File: xorg.conf - ALPS InputDevice Section
Section "InputDevice"
  Driver      "synaptics"
  Identifier "TouchPad"
  Option      "SendCoreEvents"
  Option      "Protocol" "auto-dev"
  Option      "SHMConfig" "on"
EndSection

Use the "alps" protocol if the above fails.

Additional Settings

Additional options in the InputDevice section can be used to fine tune the touchpad's behavior. A list of these settings and their meaning is available in man synaptics. These are some examples:

Code: xorg.conf - Defaults similar to MS Windows's behavior
    Option   "LeftEdge" "1900"
    Option   "RightEdge" "5400"
    Option   "TopEdge" "1400"
    Option   "BottomEdge" "4500"
    Option   "FingerLow" "25"
    Option   "FingerHigh" "30"
    Option   "MaxTapTime" "180"
    Option   "MaxTapMove" "220"
    Option   "VertScrollDelta" "100"
    Option   "MinSpeed" "0.02"
    Option   "MaxSpeed" "0.18"
    Option   "AccelFactor" "0.0010"
Code: Example 1
    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.09"
    Option   "MaxSpeed" "0.18"
    Option   "AccelFactor" "0.0015"
Code: Example 2
    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.60"
    Option   "MaxSpeed" "1.10"
    Option   "AccelFactor" "0.030"
    Option   "EdgeMotionMinSpeed" "200"
    Option   "EdgeMotionMaxSpeed" "200"
    Option   "UpDownScrolling" "1"
    Option   "CircularScrolling" "1"
    Option   "CircScrollDelta" "0.1"
    Option   "CircScrollTrigger" "2"
Code: For AlpsPS/2 ALPS GlidePoint
    Option   "LeftEdge" "130"
    Option   "RightEdge" "840"
    Option   "TopEdge" "130"
    Option   "BottomEdge" "640"
    Option   "FingerLow" "7"
    Option   "FingerHigh" "8"
    Option   "MaxTapTime" "180"
    Option   "MinTapTime" "110"
    Option   "ClickTime" "0"
    Option   "EmulateMidButtonTime" "75"
    Option   "VertScrollDelta" "20"
    Option   "HorizScrollDelta" "20"
    Option   "MinSpeed" "0.40"
    Option   "MaxSpeed" "0.65"
    Option   "AccelFactor" "0.030"
    Option   "EdgeMotionMinSpeed" "200"
    Option   "EdgeMotionMaxSpeed" "200"
    Option "UpDownScrolling" "1"
    Option "CircularScrolling" "1"
    Option "CircScrollDelta" "0.1"
    Option "CircScrollTrigger" "3"
    Option "VertEdgeScroll" "on"
Code: Example 3
    Option "Buttons" "7"
    Option "Emulate3Buttons" "true"
    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 "MinSpeed" "0.06"
    Option "MaxSpeed" "0.28"
    Option "AccelFactor" "0.0020"
    Option "VertScrollDelta" "100"
    Option "HorizScrollDelta" "430"
    Option "EmulateMidButtonTime" "75"
    Option "EdgeMotionUseAlways" "1"

Tips and Tricks

Prevent Accidental Mouse Movement

NB. Starting syndaemon from init.d doesn't work. See bug #37767. Autostart syndaemon from your windowmanager instead.

If your laptop has a compact physical layout, you may often have accidental mouse clicks while typing. syndaemon (part of the synaptics package) can be used to disable the Touchpad while keyboard keys are pressed.

Add the daemon to system startup:
rc-update add syndaemon default
Its configuration file is /etc/conf.d/syndaemon. If you wish to use modifier keys (eg: Ctrl, Alt) while moving the mouse, add -k to the SYNDAEMON_OPTS in the config file:
File: /etc/conf.d/syndaemon
SYNDAEMON_OPTS="-k"

Read syndaemon's man page for more options to control disabling the touchpad while typing.

Two Finger Click Transforms

Note: This has been integrated into the newer versions of synaptics.

There is a patch for the synaptics driver version 0.14.6 written by Douglas Mayle which enables two finger clicking similar to that found in OS X. To install, you'll need to create a portage overlay and patch the synaptics sources.

Code: Two finger click installation steps

get the sources:

emerge -1f =x11-drivers/synaptics-0.14.6

unzip them to the current working directory:

tar xjvf /usr/portage/distfiles/synaptics-0.14.6.tar.bz2

Patch the sources:[This files shows 404]

wget http://douglas.mayle.org/synaptics-two-finger-click.diff -q -O- | patch -p0

place the patched sources into distfiles:

tar cjvf /usr/portage/distfiles/synaptics-0.14.6.tar.bz2 synaptics-0.14.6

prepare the overlay:

mkdir -p /usr/local/portage/x11-drivers/synaptics

copy the existing ebuild and files:

cp -R /usr/portage/x11-drivers/synaptics/{synaptics-0.14.6.ebuild,files} /usr/local/portage/x11-drivers/synaptics

redigest the ebuild to accept the patched sources:

ebuild /usr/local/portage/x11-drivers/synaptics/synaptics-0.14.6.ebuild digest

enable the overlay if needed:

sed -i -e 's@^\(PORTDIR_OVERLAY=.*\)$@\1 /usr/local/portage@' -e 's@^#PORTDIR_OVERLAY=.*$@PORTDIR_OVERLAY=/usr/local/portage@' /etc/make.conf

emerge the package

emerge -1 =x11-drivers/synaptics-0.14.6


Real-Time Tweaking

As of version 0.14.4 of the synaptics package, changes can be made to the touchpad configuration without restarting X using synclient. These changes are not permanent, and must be explicitly set via xorg.conf, or in a startup script.

Examples:

  • List of available parameters : synclient -l
  • Decreasing the RightEdge value to 5000 may allow for easier verticall scrolling: synclient RightEdge=5000.
  • Turn off the Tap-to-Click feature: synclient MaxTapTime=0.

Usability Tips:

  • Convenient one-liner to format the output of synclient -l for use in xorg.conf:
    synclient -l | awk '/=/{printf "Option \"%s\" \"%s\"\n",$1,$3}'
  • Bash completion script for synclient:
File: /etc/bash_completion.d/synclient
# synclient(1) completion
# For /etc/bash_completion.d/
# by Luke W. Hudson
have synclient && \
_synclient()
{
     local cur
     COMPREPLY=()
     cur=${COMP_WORDS[COMP_CWORD]}
     if [[ "$cur" == "-*" ]]; then
           T_IFS="$IFS"
     else
           WORDS=$(synclient -l | awk '{print $1$2$3}' | grep -v '^Parameter' | sort)
           COMPREPLY=($(compgen -W "$WORDS" -- $cur ))
     fi
}
complete -F _synclient synclient

Troubleshooting

Horizontal Scroll Issues with Firefox

Firefox may misinterpret the horizontal scroll as 'back' and 'forward'.

One option is to disable horizontal scroll by adding Option "HorizScrollDelta" "0" into the input section of your /etc/X11/xorg.conf.

Another options is to configure Firefox so that it doesn't misinterpret the horizontal scroll. In firefox type in the address about:config. Find the following lines and modify their values by double-clicking them:

Code: about:config
mousewheel.horizscroll.withnokey.action       0
mousewheel.horizscroll.withnokey.sysnumlines  true

Setting action to 1 enables horizontal scrolling, and setting it to 2 enables forward and back pages feature.

If you actually want this feature (left scrolling takes you back, and right scrolling makes firefox go forward), set these values:

Code: about:config
mousewheel.horizscroll.withnokey.action      2
mousewheel.horizscroll.withnokey.numlines    -1 
mousewheel.horizscroll.withnokey.sysnumlines false
Note: Setting numlines to -1 or 1 is used to change directions of a back/forward gesture.

Opera

To configure Opera to recognize horizontal scrolling, go to Preferences > Advanced > Shortcuts and click the Edit button next to Mouse setup. Expand the Application section and delete the two entries Button6, Back and Button7, Forward.

This 'fix' may not work as intended in Opera 10.10. Instead of deleting entries, modify the actions to Button6, Scroll left and Button7, Scroll right.

"Can't access shared memory area. SHMConfig disabled?" error

  • Check that Option "SHMConfig" "on" is present in xorg.conf.
  • Check that the "Device" option is configured properly.
  • Make sure that your touchpad configuration is not overruled by your mouse configuration. That may happen if the mouse InputDevice comes before the touchpad InputDevice in Section "ServerLayout" in /etc/X11/xorg.conf.
    Note: Setting the "SHMConfig" option to "true" doesn't work in newer XOrg. Change it to "on".
  • Make sure that xorg-server package was compiled with the debug USE-Flag disabled, otherwise modules loading is not possible.
  • It might also be that your computer does not recognize that you have a synaptics touchpad due to a bug. Compiling your kernel with psmouse as module, load it, unload it, touch the pad and load it again may solve it. If you have X started you have to restart it after you have reloaded the module.
  • Adding additional input devices afterwards may induce this error, because the enumeration of Synaptic input device may change,

e.g. from event1 to event2 (or mouse0 to mouse1). A better practice is to use "by-path" addressing, instead of "eventX", for Synaptics in Xorg.conf:

Identifier       "Synaptics"
...
#Option "Device" "/dev/input/event1" # the old addressing
Option "Device" "/dev/input/by-path/platform-i8042-serio-1-event-mouse" # by path addressing

Misbehaving external PS/2 mouse

Use "AlwaysCore" instead of "CorePointer" in the ServerLayout section for the "Touchpad" device. A "CorePointer" option will have to be set on another pointer input device (eg: external mouse).

Problems after upgrading to X.Org 7

A symlink might have to be created:

ln /usr/lib/modules/input/synaptic_drv.so /usr/lib/xorg/modules/input -s

This is not needed in the latest version of the synaptics driver.

If your mouse stops working, you may need to replace "AlwaysCore" with "CorePointer" or "SendCoreEvents" in the "ServerLayout" section of xorg.conf. The "AlwaysCore" option no longer exists. See [1]

Tapping does not work anymore

Probably the TapButtons have to be defined since they are not defined by default in some newer drivers.

You can try it on the fly if SHMConfig is enabled:

  synclient  TapButton1=1
  synclient  TapButton2=2
  synclient  TapButton3=3

If this works for you, you can add this configuration to your /etc/X11/xorg.conf Synaptics InputDevice section:

  Option      "TapButton1" "1"
  Option      "TapButton2" "2"
  Option      "TapButton3" "3"

I do not use the CornerButtons but maybe this is also needed:

  Option      "RTCornerButton" "2"
  Option      "RBCornerButton" "3"

If tapping still does not work and you are using xf86-input-synaptics-0.15.2-r2, try upgrading to one of the -0.99.* versions. There appears to be a bug in 0.15.2 that disables or at least cripples tapping support, according to a Red Hat bug report.

Scrolling does not work anymore

Probably the scroll variables must be set.

You can try it on the fly if SHMConfig is enabled:

  synclient VertEdgeScroll=1
  synclient VertScrollDelta=45
  synclient HorizEdgeScroll=1
  synclient HorizScrollDelta=45

If this works for you, you can add this configuration to your /etc/X11/xorg.conf Synaptics InputDevice section:

  Option      "VertEdgeScroll"    "1"
  Option      "VertScrollDelta"  "45"
  Option      "HorizEdgeScroll"   "1"
  Option      "HorizScrollDelta" "45"

See also