Note for English Readers

If I write the articles in Indonesian, I will write a summary in English so that you can read my articles too. After you read the summary and you feel that you need more information about that, please do not hesitate to contact me via e-mail that can be found in my profile.

Thank you for reading my blogs.

Friday, March 25, 2011

How to make touchpad/clickpad temporarily disable when typing?

Since my laptop has clickpad that has larger area and more sensitive than common touchpad, I get an annoying behavior of my clickpad; when I type and my thumb or palm accidentally touches or near the clickpad, the cursor will be moved to the position that is pointed by mouse pointer, so that, I will continue to type in the wrong position! I hate this behavior! I have to disable my clickpad when I am typing. There are two methods:

Method 1, I disable my clickpad permanently. I run this script to toggle on/off my clickpad:
#!/bin/bash
#Toggle touchpad
SYNSTATE=$(synclient -l | grep TouchpadOff | awk '{ print $3}')
# change state
if [ $SYNSTATE = 0 ]; then
  synclient touchpadoff=1
elif [ $SYNSTATE = 1 ]; then
  synclient touchpadoff=0
fi

Method 2, I use /usr/bin/syndaemon to disable my clickpad only when I am typing. The steps:
  1. Make ~/.xprofile
    #!/bin/sh
    # Customize X environment
    #
    # Activate syndaemon for monitoring keyboard activity and disabling # the touchpad when the keyboard is being used.
    /usr/bin/syndaemon -td
  2. Add these lines on the top of /usr/bin/startkde (if you use KDE as the default desktop manager) in order to make X server executes ~/.xprofile when it starts.
    if [ -r /etc/xprofile ]; then
            source /etc/xprofile
    fi
    if [ -r $HOME/.xprofile ]; then
            source $HOME/.xprofile
    fi
  3. Restart X server.
Currently, I use method 2 because I only disable my clickpad temporarily when syndaemon detects keyboard action and resume my clickpad function within 2 seconds after the last key pressed. For more information about syndaemon, type: man syndaemon on your console.

1 comment:

pleb said...

this solution is elegant (method2)
usually people do not get the silly things until someone else point it out.

i hope i had known this couple of months back.... (for refereces http://www.linuxquestions.org/questions/slackware-14/slackware-13-1-on-a-netbook-asus-eee-1005ha-811813/ )