SynapticsTouchpadHowTo

Differences between revisions 1 and 24 (spanning 23 versions)
Revision 1 as of 2006-04-15 12:47:20
Size: 1021
Editor: ip72-192-3-249
Comment:
Revision 24 as of 2006-07-25 13:34:27
Size: 8361
Editor: mailgate
Comment: cat doc
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
== Synaptics Touchpads ==

== for newbies ==
On laptops, the touchpad is the built-in mouse. "Synaptics touchpad" should not be confused with "Synaptic", the Ubuntu Package Manager, or Graphical User Interface equivalent of "apt-get" in a terminal.

In Breezy and later versions of Ubuntu, the synaptics touchpad on laptops should work out of the box. There should be an entry like this in /etc/xorg.conf:
||'''Contents'''[[BR]][[TableOfContents]]||
== For Newbies ==

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 {{{apt-get}}}).

In Breezy(5.10), laptops with a synaptics touchpad should work out of the box. Go to a terminal and {{{grep}}} (look inside) your {{{/etc/X11/xorg.conf}}} file:
{{{
grep Id /etc/X11/xorg.conf
}}}
If one of the lines is:
{{{
 Identifier "Synaptics Touchpad"
}}}
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.

{{{qsynaptics}}} (or in KDE {{{ksynaptics}}}) is a GUI which allows you to configure your touchpad. At a terminal, enter:
{{{
sudo apt-get install qsynaptics
}}}
or:
{{{
sudo apt-get install ksynaptics
}}}
You may need to run {{{qsynaptics -r}}} 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 ==
In order to get scrollbar support, you may need to edit your xorg.conf file. In a terminal, type: {{{gksudo gedit /etc/X11/xorg.conf}}} After the lines:
{{{
Section "InputDevice"
 Identifier "Configured Mouse"
 Driver "mouse"
 Option "CorePointer"
 Option "Device" "/dev/input/mice"
 Option "Protocol" "ExplorerPS/2"
 Option "ZAxisMapping" "4 5"
 Option "Emulate3Buttons" "true"
EndSection
}}}
add the following:
Line 15: Line 50:
EndSection
}}}

== Turning Synaptics Touchpads On/Off ==

KSynaptics should allow KDE users some control over their touchpad, though issues may exist.

In Ubuntu, 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:

1) from a terminal, edit /etc/xorg.conf:
{{{
sudo gedit /etc/xorg.conf
}}}
this will
 Option "SHMConfig" "on"
EndSection
}}}
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:
{{{
Section "ServerLayout"
 Identifier "Default Layout"
 Screen "Default Screen"
 InputDevice "Generic Keyboard"
 InputDevice "Configured Mouse"
 InputDevice "stylus" "SendCoreEvents"
 InputDevice "cursor" "SendCoreEvents"
 InputDevice "eraser" "SendCoreEvents"
EndSection
}}}
and add the following line after the "Configured Mouse" line:
{{{
 InputDevice "Synaptics Touchpad"
}}}
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> <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 ==

## Thanks to noob_Lance for [http://www.ubuntuforums.org/showthread.php?t=143095 this how-to]

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
{{{
gksudo gedit /etc/X11/xorg.conf
}}}
and look for the following section of code:

{{{
Section "InputDevice"
 Identifier "Synaptics Touchpad"
 Driver "synaptics"
 Option "SendCoreEvents" "true"
 Option "Device" "/dev/psaux"
 Option "Protocol" "auto-dev"
 Option "HorizScrollDelta" "0"
EndSection
}}}
and add one more Option at the End of the Section:
{{{
 Option "SHMConfig" "on"
EndSection
}}}

If you are using an Alps-Touchpad, which you can find out by typing
{{{
cat /proc/bus/input/devices
}}}

your code section should look like this
{{{
Section "InputDevice"
   Driver "synaptics"
   Identifier "TouchPad"
   Option "SendCoreEvents" "true"
 Option "Device" "/dev/input/event2"
   Option "Protocol" "event"
   Option "SHMConfig" "on"
EndSection
}}}

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
{{{
synclient -m l
}}}
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.


'''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, {{{cd}}} to {{{/usr/local/bin}}} and make a new file:
{{{
cd /usr/local/bin
gksudo gedit tpoff
}}}
and paste the following code in the file, save it and close it.
{{{
#!/bin/bash
#

synclient touchpadoff=1
}}}
again, make a new file:
{{{
gksudo gedit tpon
}}}
paste the following, save and close:
{{{
#!/bin/bash
#

synclient touchpadoff=0
}}}
once again, make a new file:
{{{
gksudo gedit touchpad.py
}}}
paste the following, save and close
{{{
#!/usr/bin/python
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()
}}}

and finally, change the permissions of these three files:
{{{
sudo chmod 777 tpon tpoff touchpad.py
}}}

'''Step 3'''

Next, edit your sudoers files to allow you to execute both scripts without a password.
{{{
sudo visudo
}}}
and add this line
{{{
{user} ALL = NOPASSWD: /usr/local/bin/touchpad.py
}}}
where {user} is your user name

save (in nano hit <CTRL> <o>), and make sure to save it as: {{{/etc/sudoers}}}

'''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
{{{
sudo apt-get install xbindkeys
}}}
when it's done, install xbindkeys-config, the GUI for xbindkeys
{{{
sudo apt-get install xbindkeys-config
}}}
once each is installed, start both applications:
{{{
xbindkeys
}}}and
{{{
xbindkeys-config
}}}

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:

{{{
xbindkeys
}}}

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> and add it.

== 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.

{{{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}}}
----
CategoryDocumentation

For Newbies

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 apt-get).

In Breezy(5.10), laptops with a synaptics touchpad should work out of the box. Go to a terminal and grep (look inside) your /etc/X11/xorg.conf file:

grep Id /etc/X11/xorg.conf

If one of the lines is:

        Identifier      "Synaptics Touchpad"

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.

qsynaptics (or in KDE ksynaptics) is a GUI which allows you to configure your touchpad. At a terminal, enter:

sudo apt-get install qsynaptics

or:

sudo apt-get install ksynaptics

You may need to run qsynaptics -r 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

In order to get scrollbar support, you may need to edit your xorg.conf file. In a terminal, type: gksudo gedit /etc/X11/xorg.conf After the lines:

Section "InputDevice"
        Identifier      "Configured Mouse"
        Driver          "mouse"
        Option          "CorePointer"
        Option          "Device"                "/dev/input/mice"
        Option          "Protocol"              "ExplorerPS/2"
        Option          "ZAxisMapping"          "4 5"
        Option          "Emulate3Buttons"       "true"
EndSection

add the following:

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

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:

Section "ServerLayout"
        Identifier      "Default Layout"
        Screen          "Default Screen"
        InputDevice     "Generic Keyboard"
        InputDevice     "Configured Mouse"
        InputDevice     "stylus" "SendCoreEvents"
        InputDevice     "cursor" "SendCoreEvents"
        InputDevice     "eraser" "SendCoreEvents"
EndSection

and add the following line after the "Configured Mouse" line:

        InputDevice     "Synaptics Touchpad"

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> <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

gksudo gedit /etc/X11/xorg.conf

and look for the following section of code:

Section "InputDevice"
        Identifier      "Synaptics Touchpad"
        Driver          "synaptics"
        Option          "SendCoreEvents"        "true"
        Option          "Device"                "/dev/psaux"
        Option          "Protocol"              "auto-dev"
        Option          "HorizScrollDelta"      "0"
EndSection

and add one more Option at the End of the Section:

        Option          "SHMConfig"             "on"
EndSection

If you are using an Alps-Touchpad, which you can find out by typing

cat /proc/bus/input/devices

your code section should look like this

Section "InputDevice"
        Driver          "synaptics"
        Identifier      "TouchPad"
        Option          "SendCoreEvents"        "true"
        Option          "Device"                "/dev/input/event2"
        Option          "Protocol"              "event"
        Option          "SHMConfig"             "on"
EndSection

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

synclient -m l

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.

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, cd to /usr/local/bin and make a new file:

cd /usr/local/bin
gksudo gedit tpoff

and paste the following code in the file, save it and close it.

#

synclient touchpadoff=1 

again, make a new file:

gksudo gedit tpon

paste the following, save and close:

#

synclient touchpadoff=0

once again, make a new file:

gksudo gedit touchpad.py

paste the following, save and close

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()

and finally, change the permissions of these three files:

sudo chmod 777 tpon tpoff touchpad.py

Step 3

Next, edit your sudoers files to allow you to execute both scripts without a password.

sudo visudo

and add this line

{user}   ALL = NOPASSWD: /usr/local/bin/touchpad.py

where {user} is your user name

save (in nano hit <CTRL> <o>), and make sure to save it as: /etc/sudoers

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

sudo apt-get install xbindkeys

when it's done, install xbindkeys-config, the GUI for xbindkeys

sudo apt-get install xbindkeys-config

once each is installed, start both applications:

xbindkeys

and

xbindkeys-config

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:

xbindkeys

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> and add it.

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.

{{{Section "InputDevice"

EndSection}}}


CategoryDocumentation

SynapticsTouchpadHowTo (last edited 2008-08-06 17:00:08 by localhost)