SynapticsTouchpadHowTo

Differences between revisions 1 and 2
Revision 1 as of 2006-04-15 12:47:20
Size: 1021
Editor: ip72-192-3-249
Comment:
Revision 2 as of 2006-04-15 14:56:42
Size: 5399
Editor: ip72-192-3-249
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
== Synaptics Touchpads ==

== for newbies ==
== For Newbies ==
Line 6: Line 5:
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: In Breezy and later versions of Ubuntu, laptops with a synaptics touchpad should work out of the box. Go to a terminal and grep (look inside) your xorg.conf file:
{{{
grep Id /etc/X11/xorg.conf
}}}
If one of the lines is:
{{{
 Identifier "Synaptics Touchpad"
}}}
then you have a Synaptics Touchpad.

== Turning Synaptics Touchpads On/Off ==

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.

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

In Ubuntu, use following steps:

'''Step 1'''

from a terminal, edit /etc/xorg.conf
{{{
sudo gedit /etc/X11/xorg.conf
}}}
and look for the following section of code:
Line 17: Line 41:

== 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
and add one more Option at the End of the Section:
{{{
 Option "SHMConfig" "on"
EndSection
}}}
'''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, go to /usr/local/bin and make a new file:
{{{
cd /usr/local/bin
sudo 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:
{{{
sudo gedit tpon
}}}
paste the following, save and close:
{{{
#!/bin/bash
#

synclient touchpadoff=0
}}}
once again, make a new file:
{{{
sudo gedit touchpad.py
}}}
{{{
#!/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()
}}}

'''Step 3'''
Change the permissions:
{{{
sudo chmod 777 tpon tpoff touchpad.py
}}}

'''Step 4'''
Edit your sudoers files to allow you to exe both scripts without a password.

[b]Step 4[/b]
so use the following command
[CODE]
sudo visudo
[/CODE]

and add these 2 lines
[CODE]
{user} ALL = NOPASSWD: /usr/local/bin/tpoff
{user} ALL = NOPASSWD: /usr/local/bin/tpon
[/CODE]
where {user} is your user name

then save.

[b]Step 5[/b]
Next install the following 2 programs

xbindkeys
[CODE]
sudo apt-get install xbindkeys
[/CODE]

and xbindkeys-config, the GUI for xbindkeys
[CODE]
sudo apt-get install xbindkeys-config
[/CODE]

once installed start both application
[CODE]
xbindkeys
[/CODE]
and
[CODE]
xbindkeys-config
[/CODE]

[b]Step 6[/b]
then go ahead and edit your file to the shortcuts you want to exe the script with. then for the action, set it to /usr/local/bin/ (the name of the script)


The way i set mine up is as follows, under Edit:
Name: Touchpad Off
Key: Control + F5 | m:0x4 + c:71
Action: /usr/local/bin/tpoff

Thats it for turning it off.

then at the bottom, hit New and enter the following
Name: Touchpad On
Key: Control + F6 | m:0x4 + c:72
Action: /usr/local/bin/tpon

then click apply & save & exit

Now that that is done we have to restart the xbindkeys.

[CODE]
xbindkeys
[/CODE]

Now go try it out :D and have some fun.. your touchpad problems are now solved :D

If there are any suggestions or anything please feel free to post it. My next revision is to make it with jsut one key and one script. but since this is my first howto... go easy on me :D

For all those who are sick of the touchpad always messed up for work.. your welcome :D


~Lance

Ok Above Was The Previous Version. I want to point out that i did change the previous howto to include step numbers. those will be seen below :).

Follow These Steps.. any wth a * refer to the ones above has they have not changed:

[b]*Step 1[/b]

[b]Step 2[/b]
Download the file i have attached below and upack it to [b]/usr/local/bin/[/b]
ones unzipped, you will have to chmod it to 777.
[CODE]
chmod 777 /usr/local/bin/touchpad.py
[/CODE]

[b]Step 3[/b]
Edit the sudoers file (like above).. but change the 2 lines you need to insert to jsut this line:
[CODE]
{user} ALL = NOPASSWD: /usr/local/bin/touchpad.py
[/CODE]

[b]Step 4[/b]
refer to *Step 5

[b]Step 5[/b]
Now Here Is Where The Real Update Is. Instead of having to remember 2 key combos to turn it on and off... this script i made will use only one key combo and do both functions :D life jsut got easier.

The way i set mine up is as follows, under Edit:
Name: Touchpad Control
Key: Control + F5 | m:0x4 + c:71
Action: /usr/local/bin/touchpad.py

[b]Step 6[/b]
Restart xbindkeys and your set to go :D ENJOY EVERYONE![/QUOTE]

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, laptops with a synaptics touchpad should work out of the box. Go to a terminal and grep (look inside) your xorg.conf file:

grep Id /etc/X11/xorg.conf

If one of the lines is:

        Identifier      "Synaptics Touchpad"

then you have a Synaptics Touchpad.

Turning Synaptics Touchpads On/Off

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.

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

In Ubuntu, use following steps:

Step 1

from a terminal, edit /etc/xorg.conf

sudo 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

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

cd /usr/local/bin
sudo gedit tpoff

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

#

synclient touchpadoff=1 

again, make a new file:

sudo gedit tpon

paste the following, save and close:

#

synclient touchpadoff=0

once again, make a new file:

sudo gedit touchpad.py

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

Step 3 Change the permissions:

sudo chmod 777 tpon tpoff touchpad.py

Step 4 Edit your sudoers files to allow you to exe both scripts without a password.

[b]Step 4[/b] so use the following command [CODE] sudo visudo [/CODE]

and add these 2 lines [CODE] {user} ALL = NOPASSWD: /usr/local/bin/tpoff {user} ALL = NOPASSWD: /usr/local/bin/tpon [/CODE] where {user} is your user name

then save.

[b]Step 5[/b] Next install the following 2 programs

xbindkeys [CODE] sudo apt-get install xbindkeys [/CODE]

and xbindkeys-config, the GUI for xbindkeys [CODE] sudo apt-get install xbindkeys-config [/CODE]

once installed start both application [CODE] xbindkeys [/CODE] and [CODE] xbindkeys-config [/CODE]

[b]Step 6[/b] then go ahead and edit your file to the shortcuts you want to exe the script with. then for the action, set it to /usr/local/bin/ (the name of the script)

The way i set mine up is as follows, under Edit: Name: Touchpad Off Key: Control + F5 | m:0x4 + c:71 Action: /usr/local/bin/tpoff

Thats it for turning it off.

then at the bottom, hit New and enter the following Name: Touchpad On Key: Control + F6 | m:0x4 + c:72 Action: /usr/local/bin/tpon

then click apply & save & exit

Now that that is done we have to restart the xbindkeys.

[CODE] xbindkeys [/CODE]

Now go try it out Big Grin :) and have some fun.. your touchpad problems are now solved Big Grin :)

If there are any suggestions or anything please feel free to post it. My next revision is to make it with jsut one key and one script. but since this is my first howto... go easy on me Big Grin :)

For all those who are sick of the touchpad always messed up for work.. your welcome Big Grin :)

~Lance

Ok Above Was The Previous Version. I want to point out that i did change the previous howto to include step numbers. those will be seen below :).

Follow These Steps.. any wth a * refer to the ones above has they have not changed:

[b]*Step 1[/b]

[b]Step 2[/b] Download the file i have attached below and upack it to [b]/usr/local/bin/[/b] ones unzipped, you will have to chmod it to 777. [CODE] chmod 777 /usr/local/bin/touchpad.py [/CODE]

[b]Step 3[/b] Edit the sudoers file (like above).. but change the 2 lines you need to insert to jsut this line: [CODE] {user} ALL = NOPASSWD: /usr/local/bin/touchpad.py [/CODE]

[b]Step 4[/b] refer to *Step 5

[b]Step 5[/b] Now Here Is Where The Real Update Is. Instead of having to remember 2 key combos to turn it on and off... this script i made will use only one key combo and do both functions Big Grin :) life jsut got easier.

The way i set mine up is as follows, under Edit: Name: Touchpad Control Key: Control + F5 | m:0x4 + c:71 Action: /usr/local/bin/touchpad.py

[b]Step 6[/b] Restart xbindkeys and your set to go Big Grin :) ENJOY EVERYONE![/QUOTE]

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