Place Ghantoos

Disable touchpad while typing on keyboard

Tagged:

I don’t know how you feel about it, but when my hand touches the touchpad “mouse pad” while I am typing on my keyboard, and changes to windows focus or the mouse positioning, it annoys me, A LOT!

So here’s what I did to get over this issue on my debian box. It shouldn’t be very different on other distributions. (I’ll update this post in case I ever try it somewhere else)


First edit /etc/X11/xorg.conf and change the mouse driver to synaptics (if it is not already so) adding the “SHMConfig” option:

Section "InputDevice"
    Identifier     "Synaptics Touchpad"
    Driver         "synaptics"
    Option         "SendCoreEvents" "true"
    Option         "Device" "/dev/psaux"
    Option         "Protocol" "auto-dev"
    Option         "LeftEdge" "120"
    Option         "RightEdge" "830"
    Option         "TopEdge" "120"
    Option         "BottomEdge" "650"
    Option         "FingerLow" "14"
    Option         "FingerHigh" "15"
    Option         "MaxTapTime" "180"
    Option         "MaxTapMove" "110"
    Option         "ClickTime" "0"
    Option         "EmulateMidButtonTime" "75"
    Option         "VertScrollDelta" "10"
    Option         "HorizScrollDelta" "0"
    Option         "MinSpeed" "0.45"
    Option         "MaxSpeed" "0.75"
    Option         "AccelFactor" "0.020"
    Option         "EdgeMotionMinSpeed" "200"
    Option         "EdgeMotionMaxSpeed" "200"
    Option         "UpDownScrolling" "1"
    Option         "CircularScrolling" "0"
    Option         "SHMConfig" "true"
EndSection

This sets up a lot of things. I’ve put in bold the important lines.

Once this is done, restart X, log back in and check if the synaptic driver has been loaded:

# IN CASE IT DIDN'T WORK
$ synclient -l
Can't access shared memory area. SHMConfig disabled?

# IN CASE THE DRIVER HAS BEEN LOADED
$ synclient -l
Parameter settings:
    LeftEdge                = 102
    RightEdge               = 921
    TopEdge                 = 76
    BottomEdge              = 691
    FingerLow               = 25
    FingerHigh              = 30
    (...)

The trick is now pretty easy. We will set the touchpad to remain idle when we are typing and remain in this state for 1 second after we stop typing. It should also be started as a daemon:

syndaemon -i 1 -d

# in case your a using Ubuntu Jaunty add the -S flag (thank you tharkundun for the input): 
syndaemon -i 1 -d -S

# from the man:
OPTIONS
       -i 
              How  many  seconds  to  wait  after  the  last  key press before
              enabling the touchpad.  (default is 2.0s).

       -d     Start as a daemon, ie in the background.

This should be it! Your touchpad must now be disabled while your are typing, and come back one second after you are done.

To load this at the startup of your X session, add it to your .xsession:

echo "/usr/bin/syndaemon -i 1 -d" >> ~/.xsession

# in case you are using Ubuntu Jaunty: echo "/usr/bin/syndaemon -i 1 -d -S" >> ~/.xsession

# make usre your .xsession is executable:
chmod u+x ~/.xsession

(for gnome users, you can add it in go to “System -> Preferences -> Sessions -> Add” or add it to ~/.gnomerc)

Voilà!

Cheers,
Ignace M -ghantoos-

Tagged:

2 Responses

  1. tharkundun says:

    Nice tips, thanks!
    I was going mad about this.

    For information : i must add “-S” to the syndaemon on a ubuntu jaunty.

    bye !!

  2. Thank you tharkundun for the input! The article has been updated.

    Cheers,
    Ignace M -ghantoos-

Leave a Reply