个人工具

“UbuntuHelp:SynapticsTouchpad”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(新页面: {{From|https://help.ubuntu.com/community/SynapticsTouchpad}} {{Languages|UbuntuHelp:SynapticsTouchpad}} === For Newbies === On laptops, the [http://en.wikipedia.org/wiki/Touchpad touchp...)
 
 
(未显示2个用户的8个中间版本)
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/SynapticsTouchpad}}
 
{{From|https://help.ubuntu.com/community/SynapticsTouchpad}}
 
{{Languages|UbuntuHelp:SynapticsTouchpad}}
 
{{Languages|UbuntuHelp:SynapticsTouchpad}}
 +
#title Synaptics Touchpad
 +
On most laptops, a '''[http://en.wikipedia.org/wiki/Touchpad touchpad]''' is the input device used as a substitute for a computer mouse.
 +
The term "Synaptics Touchpad" should not be confused with "[[UbuntuHelp:SynapticHowto|Synaptic]]", Ubuntu's Package Manager.
 +
== Disabling Touchpad for X.Org ==
 +
'''The easiest way to disable the Touchpad for X.Org system-wide, is to uninstall the package xserver-xorg-input-synaptics.'''
 +
== Other Configuration Methods ==
 +
For Ubuntu 8.04 and earlier, see [[UbuntuHelp:SynapticsTouchpad/Hardy| the older instructions]].
 +
<<Anchor(gui)>>
 +
== Basic Configuration with a Graphical Interface ==
 +
Ubuntu provides configuration of the most common touchpad options in '''System > Preferences > Mouse''', under the Touchpad tab. If you cannot find this tab, see the Troubleshooting section at the end of this page.
 +
Try the touchpad after unchecking the '''Enable mouse clicks with touchpad''' check box.
 +
Check operation after '''Enable horizontal scrolling''' is checked. This may not have been the default setting.
 +
If all else fails, when using two hands for operation, remember to lift your finger off of the touchpad when leaving a scroll bar, window or workspace.
 +
== Advanced Configuration with a Graphical Interface ==
 +
This sections describes how to install a GUI configuration tool for your Synaptics touchpad which integrates into your desktop environment. Other methods of configuring the touchpad include using [[UbuntuHelp:[synclient|synclient]]] on the command line, or by [[UbuntuHelp:[hal|adding options]]] to HAL fdi files.
 +
<<Anchor(gsynaptics)>>
 +
=== Ubuntu ===
 +
* [[UbuntuHelp:[shmconfig|Enable SHMConfig]]].
 +
* For a preference tool which integrates into the GNOME Desktop environment, install the '''gsynaptics''' package from the universe repository. For help with installing packages see [[UbuntuHelp:InstallingSoftware|InstallingSoftware]].
 +
After installation, '''gsynaptics''' can be found under '''System > Preferences > Touchpad'''.
 +
<<Anchor(ksynaptics)>>
 +
=== Kubuntu ===
 +
* [[UbuntuHelp:[shmconfig|Enable SHMConfig]]].
 +
* The preference tool which integrates into the KDE desktop environment, '''ksynaptics''' package from the universe repository, is no longer in the Intrepid Repositories. Until the tool is updated, please use the method for Xubuntu and others below.
 +
<<Anchor(qsynaptics)>>
 +
=== Xubuntu and others ===
 +
* [[UbuntuHelp:[shmconfig|Enable SHMConfig]]].
 +
* For users of Xfce or anything else besides GNOME or KDE, install the '''qsynaptics''' package from the universe repository. For help with installing packages see [[UbuntuHelp:InstallingSoftware|InstallingSoftware]].
 +
* Note: qsynaptics is no longer in the repositories either as of Jaunty.  gsynaptics is the only remaining option for a full featured gui currently.  There is a gui program called touchfreeze which can pause your touchpad while you are typing to help reduce erroneous touchpad actions using syndaemon below automatically.
 +
<<Anchor(resume)>>
 +
=== Restoring gsynaptics settings on resume ===
 +
* Upon resuming from suspend gsynaptics-init needs to be run for each open X session, I've written a script to put in /etc/pm/sleep.d/98gsynaptics to do that automatically
 +
<pre><nowiki>#!Shell
  
=== For Newbies ===
+
#!/bin/bash
  
On laptops, the [http://en.wikipedia.org/wiki/Touchpad touchpad] is the built-in mouse. "Synaptics touchpad" should not be confused with "Synaptic" - Ubuntu's Package Manager (Graphical User Interface for <code><nowiki>apt-get</nowiki></code>).
+
# Only run on resume/thaw
 +
if [[ ${1} =~ (thaw|resume) ]] ; then
  
In Breezy(5.10), laptops with a synaptics touchpad should work out of the box. Go to a terminal and <code><nowiki>grep</nowiki></code> (look inside) your <code><nowiki>/etc/X11/xorg.conf</nowiki></code> file:
+
  synaptics() {
<pre><nowiki>
+
grep Id /etc/X11/xorg.conf
+
</nowiki></pre>
+
If one of the lines is:
+
<pre><nowiki>
+
Identifier "Synaptics Touchpad"
+
</nowiki></pre>
+
then you have a Synaptics Touchpad.
+
  
In Dapper flight 7 (6.06), synaptics touchpads seem to be misdetected as some kind of wacom device, so the scrollbar may not work. See - "Editing Your xorg.conf File to Include Synaptics Touchpad drivers" - for scrollbar support.
+
    # sleep to give time for X
 +
    sleep 4s
  
<code><nowiki>qsynaptics</nowiki></code> (or in KDE <code><nowiki>ksynaptics</nowiki></code>) is a GUI which allows you to configure your touchpad. At a terminal, enter:
+
    who | while read line ; do
<pre><nowiki>
+
      a=(${line})
sudo apt-get install qsynaptics
+
      regex="^:[[:digit:]]"
</nowiki></pre>
+
      if [[ ${a[1]} =~ $regex ]] ; then
or:
+
        init="sudo -H -u ${a[0]} DISPLAY=${a[1]} gsynaptics-init"
<pre><nowiki>
+
        eval "${init}"
sudo apt-get install ksynaptics
+
      fi
</nowiki></pre>
+
    done
You may need to run <code><nowiki>qsynaptics -r</nowiki></code> each time you restart X. Go to System>Preferences>Sessions>Startup Programs> and add it.
+
  }
  
=== Dapper: Editing Your xorg.conf File to Include Synaptics Touchpad ===
+
  # run in background so sleep doesn't hold up resume
In order to get scrollbar support, you may need to edit your xorg.conf file. In a terminal, type: <code><nowiki>gksudo gedit /etc/X11/xorg.conf</nowiki></code> After the lines:
+
  synaptics &
<pre><nowiki>
+
  # disown so exiting shell doesn't kill function
Section "InputDevice"
+
  disown %1
Identifier "Configured Mouse"
+
Driver "mouse"
+
Option "CorePointer"
+
Option "Device" "/dev/input/mice"
+
Option "Protocol" "ExplorerPS/2"
+
Option "ZAxisMapping" "4 5"
+
Option "Emulate3Buttons" "true"
+
EndSection
+
</nowiki></pre>
+
add the following:
+
<pre><nowiki>
+
Section "InputDevice"
+
Identifier "Synaptics Touchpad"
+
Driver "synaptics"
+
Option "SendCoreEvents" "true"
+
Option "Device" "/dev/psaux"
+
Option "Protocol" "auto-dev"
+
Option "HorizScrollDelta" "0"
+
Option      "SHMConfig" "on"
+
EndSection
+
</nowiki></pre>
+
there are also a bunch of lines about a wacom tablet, I have commented them out, I am not sure if that is a necessary step. -brallan
+
  
next, find the bit near the bottom where it says:
+
fi
<pre><nowiki>
+
Section "ServerLayout"
+
Identifier "Default Layout"
+
Screen "Default Screen"
+
InputDevice "Generic Keyboard"
+
InputDevice "Configured Mouse"
+
InputDevice    "stylus" "SendCoreEvents"
+
InputDevice    "cursor" "SendCoreEvents"
+
InputDevice    "eraser" "SendCoreEvents"
+
EndSection
+
</nowiki></pre>
+
and add the following line after the "Configured Mouse" line:
+
<pre><nowiki>
+
InputDevice "Synaptics Touchpad"
+
</nowiki></pre>
+
i also commented out the three lines about the wacom: "stylus", "cursor", and "eraser", but I am not sure if this is necessary. -brallan.
+
  
restart X: <ctrl> <alt> <Backspace> and you should now have scrollbar support. Install qsynaptics for fine control over the device.
 
 
=== Turning Synaptics Touchpads On/Off with a shortcut key ===
 
 
 
You may wish to turn the touchpad on or off so that it doesn't interfere with typing when using a USB or other mouse.
 
 
Use following steps:
 
 
'''Step 1'''
 
 
from a terminal, edit /etc/xorg.conf
 
<pre><nowiki>
 
gksudo gedit /etc/X11/xorg.conf
 
 
</nowiki></pre>
 
</nowiki></pre>
and look for the following section of code:
+
<<Anchor(syndaemon)>>
 
+
== Disabling the Touchpad Temporarily While Typing ==
 +
To avoid accidental mouse movement while typing, '''syndaemon''' can be used to monitor the keyboard activity and disable the touchpad for a period of time after the last keystroke.
 +
The following commands should be typed in a [[UbuntuHelp:UsingTheTerminal|terminal]].
 +
The '''-d''' option causes '''syndaemon''' to run in the background, so the terminal can be closed after executing the command.
 
<pre><nowiki>
 
<pre><nowiki>
Section "InputDevice"
+
syndaemon -d
Identifier "Synaptics Touchpad"
+
Driver "synaptics"
+
Option "SendCoreEvents" "true"
+
Option "Device" "/dev/psaux"
+
Option "Protocol" "auto-dev"
+
Option "HorizScrollDelta" "0"
+
EndSection
+
 
</nowiki></pre>
 
</nowiki></pre>
and add one more Option at the End of the Section:
+
The '''-t''' option causes '''syndaemon''' to only disable tapping and scrolling, not mouse movements:
 
<pre><nowiki>
 
<pre><nowiki>
Option      "SHMConfig" "on"
+
syndaemon -d -t
EndSection
+
 
</nowiki></pre>
 
</nowiki></pre>
 
+
By default '''syndaemon''' disables the touchpad for 2 seconds after the last keyboard activity. To specify a different timeout, use the '''-i''' option. For example, a timeout of 1 second:
If you are using an Alps-Touchpad, which you can find out by typing
+
 
<pre><nowiki>
 
<pre><nowiki>
cat /proc/bus/input/devices
+
syndaemon -d -i 1
 
</nowiki></pre>
 
</nowiki></pre>
 
+
If syndaemon doesn't work properly out of the box, try [[UbuntuHelp:[shmconfig|enabling SHMConfig]]], and force syndaemon to use it by passing the -S option. (This might generally be the case if you only use HAL fdi(as described further below) to configure your input interfaces for xorg)
your code section should look like this
+
 
<pre><nowiki>
 
<pre><nowiki>
Section "InputDevice"
+
syndaemon -d -i 1 -S
Driver  "synaptics"
+
Identifier  "TouchPad"
+
Option "SendCoreEvents" "true"
+
Option "Device" "/dev/input/event2"
+
Option "Protocol" "event"
+
Option          "SHMConfig"            "on"
+
EndSection
+
 
</nowiki></pre>
 
</nowiki></pre>
 
+
Further options can be found by reviewing the ''man'' page with:
You can define some parameters which influence the behaviour of your touchpad. These parameters are presented already in [https://wiki.ubuntu.com/SynapticsTouchpadWartyHowto?highlight=%28touchpad%29]. You can check if your touchpad works correct and you have the correct parameters with
+
 
<pre><nowiki>
 
<pre><nowiki>
synclient -m l
+
man syndaemon
 
</nowiki></pre>
 
</nowiki></pre>
If everything works fine, the position of your finger will be updated everytime you move it and based on this information you can set your parameters.
+
The following example invokes syndaemon for 4 seconds after any keyboard activity ('''-i 4'''), except when modifier keys such as Alt or Shift are used ('''-K'''), and only disables tapping and scrolling ('''-t''') for this period.
 
+
 
+
'''Step 2'''
+
 
+
Next we will create 3 files - a bash script to turn the touchpad on, one to turn it on, and a python script to use a single key combination for both. At a terminal, <code><nowiki>cd</nowiki></code> to <code><nowiki>/usr/local/bin</nowiki></code> and make a new file:
+
 
<pre><nowiki>
 
<pre><nowiki>
cd /usr/local/bin
+
syndaemon -i 4 -d -t -K
gksudo gedit tpoff
+
 
</nowiki></pre>
 
</nowiki></pre>
and paste the following code in the file, save it and close it.
+
To make '''syndaemon''' start up each time you login, add the desired command to the list of Startup Programs in '''System > Preferences > Sessions''' or '''System > Preferences > Startup Applications'''. See [[UbuntuHelp:AddingProgramToSessionStartup|AddingProgramToSessionStartup]].
 +
In Ubuntu Karmic (9.10) '''syndaemon''' is started automatically by '''gsynaptics-init''' but can be turned off in '''System > Preferences > Mouse > Touchpad > Disable touchpad while typing''' (which alters the gconf setting: /desktop/gnome/peripherals/touchpad/disable_while_typing )
 +
<<Anchor(shmconfig)>>
 +
== Enabling SHMConfig ==
 +
'''Note:''' Tools such as '''xinput''' and '''syndaemon''' can now alter touchpad settings without needing '''SHMConfig''' to be enabled. However, SHMConfig is still required for some functionality.
 +
In order for tools such as '''[[UbuntuHelp:[synclient|synclient]]]''', '''[[UbuntuHelp:[syndaemon|syndaemon]]]''', '''[[UbuntuHelp:[gsynaptics|gsynaptics]]]''', '''[[UbuntuHelp:[ksynaptics|ksynaptics]]]''', and '''[[UbuntuHelp:[qsynaptics|qsynaptics]]]''' to work, they need access to the synaptics touchpad driver shared memory. This is done by enabling '''SHMConfig''' "on" in the X server Synaptics touchpad configuration. With this enabled, these tools can modify the run-time configuration of the touchpad input driver without restarting the X server.
 +
/!\ Note the warning from the man page for synclient:
 
<pre><nowiki>
 
<pre><nowiki>
#!/bin/bash
+
WARNING: This is not secure if you are in an untrusted multiuser
#
+
        environment. All local users can change the parameters at any time.
 
+
</nowiki></pre>
synclient touchpadoff=1
+
If this is an issue for you, the touchpad can be configured without enabling SHMConfig by placing the desired options in [[UbuntuHelp:[hal|a HAL fdi file]]] and rebooting.
</nowiki></pre>
+
In a [[UbuntuHelp:UsingTheTerminal|terminal]] type (for Gnome/Ubuntu):
again, make a new file:
+
 
<pre><nowiki>
 
<pre><nowiki>
gksudo gedit tpon
+
gksudo gedit /etc/hal/fdi/policy/shmconfig.fdi
 
</nowiki></pre>
 
</nowiki></pre>
paste the following, save and close:
+
(for KDE/Kubuntu):
 
<pre><nowiki>
 
<pre><nowiki>
#!/bin/bash
+
kdesudo kate /etc/hal/fdi/policy/shmconfig.fdi
#
+
 
+
synclient touchpadoff=0
+
 
</nowiki></pre>
 
</nowiki></pre>
once again, make a new file:
+
Put this into the file:
 
<pre><nowiki>
 
<pre><nowiki>
gksudo gedit touchpad.py
+
<?xml version="1.0" encoding="UTF-8"?>
 +
<deviceinfo version="0.2">
 +
  <device>
 +
    <match key="input.x11_driver" string="synaptics">
 +
      <merge key="input.x11_options.SHMConfig" type="string">on</merge>
 +
    </match>
 +
  </device>
 +
</deviceinfo>
 
</nowiki></pre>
 
</nowiki></pre>
paste the following, save and close
+
Save and close that file, reboot, and SHMConfig should be enabled.
 +
<<Anchor(synclient)>>
 +
== Configuration with synclient ==
 +
'''synclient''' can be used to adjust touchpad settings from the command line. This will work even if a [[UbuntuHelp:[gui|GUI Preference tool]]] is installed.
 +
Enable SHMConfig as described in the section [[UbuntuHelp:[shmconfig|Enabling SHMConfig]]].
 +
List all settings:
 
<pre><nowiki>
 
<pre><nowiki>
#!/usr/bin/python
+
synclient -l
import os
+
import string
+
+
 
+
def ReadFile():
+
myfile = open('/tmp/synclient.tmp', 'rb')
+
for line in myfile:
+
TestString(line)
+
myfile.close()
+
 
+
def TestString(string):
+
for word in string.split():
+
if word == "TouchpadOff":
+
setting = string.split()
+
ChangeState(setting[2])
+
+
 
+
def ChangeState(current):   
+
if current == "0":
+
os.system("synclient touchpadoff=1")
+
else:
+
os.system("synclient touchpadoff=0")
+
os.system("rm /tmp/synclient.tmp")
+
 
+
def Main():
+
ReadFile()
+
os.system("synclient -l > /tmp/synclient.tmp")
+
Main()
+
 
</nowiki></pre>
 
</nowiki></pre>
 
+
==== Examples ====
and finally, change the permissions of these three files:
+
Turn touchpad off:
 
<pre><nowiki>
 
<pre><nowiki>
sudo chmod 777 tpon tpoff touchpad.py
+
synclient TouchpadOff=1
 
</nowiki></pre>
 
</nowiki></pre>
 
+
Turn touchpad on:
'''Step 3'''
+
 
+
Next, edit your sudoers files to allow you to execute both scripts without a password.
+
 
<pre><nowiki>
 
<pre><nowiki>
sudo visudo
+
synclient TouchpadOff=0
 
</nowiki></pre>
 
</nowiki></pre>
and add this line
+
<<Anchor(hal)>>
 +
== Configuration with HAL fdi files ==
 +
Touchpad options can be set permanently through HAL. See [[UbuntuWiki:X/Config/Input#Input_Configuration_with_HAL|the|HAL input section of the X config documentation]] for details.
 +
<<Anchor(troubleshooting)>>
 +
== Troubleshooting ==
 +
=== Determine whether a touchpad has been detected ===
 +
To check if a touchpad has been detected open a [[UbuntuHelp:UsingTheTerminal|terminal]] and check the input device list given by this command:
 
<pre><nowiki>
 
<pre><nowiki>
{user}  ALL = NOPASSWD: /usr/local/bin/touchpad.py
+
xinput list
 
</nowiki></pre>
 
</nowiki></pre>
where {user} is your user name
+
If one of the lines mentions a touchpad (perhaps also "Synaptics" or "ALPS"), your touchpad has been detected.
 
+
If one of the lines mentions an "ADB mouse", then your touchpad is old. Use the trackpad command line tool to configure it. Here's an example to switch on tapping and dragging:
save (in nano hit <CTRL> <o>), and make sure to save it as: <code><nowiki>/etc/sudoers and not /etc/sudoers.tmp</nowiki></code>
+
 
+
'''Step 4'''
+
 
+
Alternatively to setup bellow, you might use [https://help.ubuntu.com/community/MultimediaKeys gnome-keybindings](In depth instructions, 4.) or other desktop-dependent tool.
+
 
+
Next, install xbindkeys 
+
 
<pre><nowiki>
 
<pre><nowiki>
sudo apt-get install xbindkeys
+
sudo trackpad show
 +
sudo trackpad tap
 +
sudo trackpad drag
 
</nowiki></pre>
 
</nowiki></pre>
when it's done, install xbindkeys-config, the GUI for xbindkeys
+
If nothing else works, see [[UbuntuWiki:DebuggingTouchpadDetection|the|other touchpad debugging pages]].
<pre><nowiki>
+
== See also ==
sudo apt-get install xbindkeys-config
+
* [[UbuntuHelp:SynapticsTouchpad/ShortcutKey|Turning Synaptics Touchpads On/Off with a Shortcut Key]]
</nowiki></pre>
+
once each is installed, start both applications:
+
<pre><nowiki>
+
xbindkeys
+
</nowiki></pre>and
+
<pre><nowiki>
+
xbindkeys-config
+
</nowiki></pre>
+
 
+
edit your file to the shortcut key you want. For example, to be able to switch the touchpad on/off by <Ctrl><F5>, fill in the following, under Edit:
+
 
+
Name: Touchpad On/Off
+
Key: Control + F5 | m:0x4 + c:71
+
Action: /usr/local/bin/touchpad.py
+
 
+
then click apply & save & exit
+
 
+
Now that that is done, restart xbindkeys:
+
 
+
<pre><nowiki>
+
xbindkeys
+
</nowiki></pre>
+
 
+
You may need to restart X.
+
 
+
Remember that each time you restart X, you will need to run xbindkeys again in order for the  shortcut to work. Go to System>Preferences>Sessions>Startup Programs> click add type xbindkeys then click ok.
+
 
+
=== Apple ibook G4 ===
+
 
+
With a fresh install of Dapper the touchpad works extremely slow. The bug has been filed here:  [https://launchpad.net/distros/ubuntu/+bug/28495] The fix is pretty simple. Put the following configuration into your /etc/X11/xorg.conf in the appropriate place and then restart X.
+
 
+
<pre><nowiki>Section "InputDevice"
+
Identifier "Synaptics Touchpad"
+
Driver "synaptics"
+
Option "SendCoreEvents" "true"
+
Option "Device" "/dev/input/mice"
+
Option "Protocol" "auto-dev"
+
Option "LeftEdge" "0"
+
Option "RightEdge" "850"
+
Option "TopEdge" "0"
+
Option "BottomEdge" "645"
+
Option "MinSpeed" "0.4"
+
Option "MaxSpeed" "1"
+
Option "AccelFactor" "0.03"
+
Option "FingerLow" "55"
+
Option "FingerHigh" "60"
+
Option "MaxTapMove" "20"
+
Option "MaxTapTime" "100"
+
Option "TapButton1" "0"
+
Option "TapButton2" "3"
+
Option "TabButton3" "2"
+
Option "HorizScrollDelta" "10"
+
Option "VertScrollDelta" "30"
+
Option "SHMConfig" "on"
+
EndSection</nowiki></pre>
+
 
----
 
----
[[category:CategoryCleanup]]
+
[[category:CategoryXwindowSystem]]
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2010年5月20日 (四) 00:20的最新版本


  1. title Synaptics Touchpad

On most laptops, a touchpad is the input device used as a substitute for a computer mouse. The term "Synaptics Touchpad" should not be confused with "Synaptic", Ubuntu's Package Manager.

Disabling Touchpad for X.Org

The easiest way to disable the Touchpad for X.Org system-wide, is to uninstall the package xserver-xorg-input-synaptics.

Other Configuration Methods

For Ubuntu 8.04 and earlier, see the older instructions. <<Anchor(gui)>>

Basic Configuration with a Graphical Interface

Ubuntu provides configuration of the most common touchpad options in System > Preferences > Mouse, under the Touchpad tab. If you cannot find this tab, see the Troubleshooting section at the end of this page. Try the touchpad after unchecking the Enable mouse clicks with touchpad check box. Check operation after Enable horizontal scrolling is checked. This may not have been the default setting. If all else fails, when using two hands for operation, remember to lift your finger off of the touchpad when leaving a scroll bar, window or workspace.

Advanced Configuration with a Graphical Interface

This sections describes how to install a GUI configuration tool for your Synaptics touchpad which integrates into your desktop environment. Other methods of configuring the touchpad include using [[UbuntuHelp:[synclient|synclient]]] on the command line, or by [[UbuntuHelp:[hal|adding options]]] to HAL fdi files. <<Anchor(gsynaptics)>>

Ubuntu

  • [[UbuntuHelp:[shmconfig|Enable SHMConfig]]].
  • For a preference tool which integrates into the GNOME Desktop environment, install the gsynaptics package from the universe repository. For help with installing packages see InstallingSoftware.

After installation, gsynaptics can be found under System > Preferences > Touchpad. <<Anchor(ksynaptics)>>

Kubuntu

  • [[UbuntuHelp:[shmconfig|Enable SHMConfig]]].
  • The preference tool which integrates into the KDE desktop environment, ksynaptics package from the universe repository, is no longer in the Intrepid Repositories. Until the tool is updated, please use the method for Xubuntu and others below.

<<Anchor(qsynaptics)>>

Xubuntu and others

  • [[UbuntuHelp:[shmconfig|Enable SHMConfig]]].
  • For users of Xfce or anything else besides GNOME or KDE, install the qsynaptics package from the universe repository. For help with installing packages see InstallingSoftware.
  • Note: qsynaptics is no longer in the repositories either as of Jaunty. gsynaptics is the only remaining option for a full featured gui currently. There is a gui program called touchfreeze which can pause your touchpad while you are typing to help reduce erroneous touchpad actions using syndaemon below automatically.

<<Anchor(resume)>>

Restoring gsynaptics settings on resume

  • Upon resuming from suspend gsynaptics-init needs to be run for each open X session, I've written a script to put in /etc/pm/sleep.d/98gsynaptics to do that automatically
#!Shell

#!/bin/bash

# Only run on resume/thaw
if [[ ${1} =~ (thaw|resume) ]] ; then

  synaptics() {

    # sleep to give time for X
    sleep 4s

    who | while read line ; do
      a=(${line})
      regex="^:[[:digit:]]"
      if [[ ${a[1]} =~ $regex ]] ; then
        init="sudo -H -u ${a[0]} DISPLAY=${a[1]} gsynaptics-init"
        eval "${init}"
      fi
    done
  }

  # run in background so sleep doesn't hold up resume
  synaptics &
  # disown so exiting shell doesn't kill function
  disown %1

fi

<<Anchor(syndaemon)>>

Disabling the Touchpad Temporarily While Typing

To avoid accidental mouse movement while typing, syndaemon can be used to monitor the keyboard activity and disable the touchpad for a period of time after the last keystroke. The following commands should be typed in a terminal. The -d option causes syndaemon to run in the background, so the terminal can be closed after executing the command.

syndaemon -d

The -t option causes syndaemon to only disable tapping and scrolling, not mouse movements:

syndaemon -d -t

By default syndaemon disables the touchpad for 2 seconds after the last keyboard activity. To specify a different timeout, use the -i option. For example, a timeout of 1 second:

syndaemon -d -i 1

If syndaemon doesn't work properly out of the box, try [[UbuntuHelp:[shmconfig|enabling SHMConfig]]], and force syndaemon to use it by passing the -S option. (This might generally be the case if you only use HAL fdi(as described further below) to configure your input interfaces for xorg)

syndaemon -d -i 1 -S

Further options can be found by reviewing the man page with:

man syndaemon

The following example invokes syndaemon for 4 seconds after any keyboard activity (-i 4), except when modifier keys such as Alt or Shift are used (-K), and only disables tapping and scrolling (-t) for this period.

syndaemon -i 4 -d -t -K

To make syndaemon start up each time you login, add the desired command to the list of Startup Programs in System > Preferences > Sessions or System > Preferences > Startup Applications. See AddingProgramToSessionStartup. In Ubuntu Karmic (9.10) syndaemon is started automatically by gsynaptics-init but can be turned off in System > Preferences > Mouse > Touchpad > Disable touchpad while typing (which alters the gconf setting: /desktop/gnome/peripherals/touchpad/disable_while_typing ) <<Anchor(shmconfig)>>

Enabling SHMConfig

Note: Tools such as xinput and syndaemon can now alter touchpad settings without needing SHMConfig to be enabled. However, SHMConfig is still required for some functionality. In order for tools such as [[UbuntuHelp:[synclient|synclient]]], [[UbuntuHelp:[syndaemon|syndaemon]]], [[UbuntuHelp:[gsynaptics|gsynaptics]]], [[UbuntuHelp:[ksynaptics|ksynaptics]]], and [[UbuntuHelp:[qsynaptics|qsynaptics]]] to work, they need access to the synaptics touchpad driver shared memory. This is done by enabling SHMConfig "on" in the X server Synaptics touchpad configuration. With this enabled, these tools can modify the run-time configuration of the touchpad input driver without restarting the X server. /!\ Note the warning from the man page for synclient:

WARNING: This is not secure if you are in an untrusted multiuser
         environment. All local users can change the parameters at any time.
 

If this is an issue for you, the touchpad can be configured without enabling SHMConfig by placing the desired options in [[UbuntuHelp:[hal|a HAL fdi file]]] and rebooting. In a terminal type (for Gnome/Ubuntu):

gksudo gedit /etc/hal/fdi/policy/shmconfig.fdi

(for KDE/Kubuntu):

kdesudo kate /etc/hal/fdi/policy/shmconfig.fdi

Put this into the file:

<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
  <device>
    <match key="input.x11_driver" string="synaptics">
      <merge key="input.x11_options.SHMConfig" type="string">on</merge>
    </match>
  </device>
</deviceinfo>

Save and close that file, reboot, and SHMConfig should be enabled. <<Anchor(synclient)>>

Configuration with synclient

synclient can be used to adjust touchpad settings from the command line. This will work even if a [[UbuntuHelp:[gui|GUI Preference tool]]] is installed. Enable SHMConfig as described in the section [[UbuntuHelp:[shmconfig|Enabling SHMConfig]]]. List all settings:

synclient -l

Examples

Turn touchpad off:

synclient TouchpadOff=1

Turn touchpad on:

synclient TouchpadOff=0

<<Anchor(hal)>>

Configuration with HAL fdi files

Touchpad options can be set permanently through HAL. See the|HAL input section of the X config documentation for details. <<Anchor(troubleshooting)>>

Troubleshooting

Determine whether a touchpad has been detected

To check if a touchpad has been detected open a terminal and check the input device list given by this command:

xinput list

If one of the lines mentions a touchpad (perhaps also "Synaptics" or "ALPS"), your touchpad has been detected. If one of the lines mentions an "ADB mouse", then your touchpad is old. Use the trackpad command line tool to configure it. Here's an example to switch on tapping and dragging:

sudo trackpad show
sudo trackpad tap
sudo trackpad drag

If nothing else works, see the|other touchpad debugging pages.

See also