Friday, January 11, 2008

Disabling touchpad at will

I code a lot and also write some blogs, during writing sometimes my thumb or palm touches the touchpad and results in mouse pointer moving to another window or at a different place within the same window. While coding in "vi" editor in konsole, sometimes I have even accidentally closed the konsole terminal resulting in me loosing all the unsaved work.

Now I do not want to permanently disable the touchpad of my Laptop, but was looking to find a solution where I can disable and enable it at will. I found a great article on gentoo wiki where they use ksynaptics or gsynaptics to accomplish this.
I followed their manual config and found it to be much simpler and easier than the GUI versions.

  1. Edit /etc/X11/xorg.conf. Add the Option "SHMConfig" "on" to the Section "InputDevice" where the driver is "synaptics".
    The entry would now read something like ::

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


  2. Thats it !! Config has been done. Now we just need to make use of the syndaemon utility to disable touchpad while typing.
    If I want to disable touchpad for 1 second after the last keystroke then I would type

    $syndaemon -i 1.0 -t -d

    If we see the man page of syndaemon, then we can see that "-i" governs that seconds to wait after the last key press before enabling the touchpad; "-d" makes syndaemon start as a daemon, we can close the terminal and still syndaemon will run; "-t" indicates to only diable tapping ( the accidental touch) and not mouse movements.

Job accomplished.

1 comments:

Justin said...

uhhhhhhhhhhhhhhhhhhhhh what????