Monday, July 21, 2008

Disable touchpad temporarily in HardyHeron Kubuntu/Ubuntu

This has been bugging me for a long time. Everytime i start typing a long paragraph, the cursor would randomly move to a different section of the paragraph messing up my typing.

Since the ksynaptics and gsynaptics have been removed from the HardyHeron repositories, i found these two really nice command line tools.

The syndaemon and the synclient programs

But first, before using those two command, we have to allow other programs to share the memory of the touchpad, this can be done by editing the /etc/X11/xorg.conf file. Look for a section called Synaptic Touchpad

Originally i had the section like this
Section "InputDevice"
Identifier "Synaptics Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "HorizEdgeScroll" "0"
EndSection

I had to add an extra line Option "SHMConfig" "on" so that my new configuration now looks like

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

Now the syndaemon tool is really nice that it lest you modify the touchpad parameters.
Check out
$ syndaemon --help
for more info on it.

To automatically start syndaemon when KDE starts, i had to make a script and save it in ~/.kde/Autostart folder, so i did

$ vim ~/.kde/Autostart/syndaemon.sh
#!/bin/bash
/usr/bin/syndaemon -d -i 0.8 -t

and save the file.

the -d means run in background, -i 0.8 means disable the touchpad for 0.8seconds and the -t means Only disable tapping and scrolling, not mouse movements. Ofcourse more information can be viewed from man syndaemon or syndaemon --help

Logout and Login again, Happy typing.