How To: Disabling your Touchpad while typing

2 minute read

In a previous article, I showed how to configure your laptop touchpad in such a way that you could use every neats features by using the synaptics package and configuring properly your xorg.conf.

Well, that is really enjoyable, but It can get really annoying when you type on your keyboard and still have your touchpad active as it happens that you tap on it without noticing it, resulting in messing up the job you are doing.

Hopefully, synaptics comes with two usefull tools, namely synclient and syndaemon.

Disabling the touchpad while typing avoid unwanted movements and actions from your mouse that could give focus to the wrong window, start actions because of a “click” on the wrong file and so on… Using synclient or syndaemon will stop this.

Both synclient and syndaemon need to be able to access the synaptics driver shared memory in order to work. This can be achieved by adding the right directive in your xorg.conf. So in the first place, edit /etc/X11/xorg.conf and make sure:

Option "SHMConfig" "on"

is present under the section where your touchpad configuration is defined.

Now that everything is properly set, lets discover what those tools provide us.

synclient is a tool to query and modify the Synaptics Touchpad Driver parameters on the fly.

In order to get your synaptics driver configuration, you need to type:

synclient -l

When the touchpad is active, you should get the following line:

TouchpadOff = 0

In order to disable your touchpad, you can simply type:

synclient TouchpadOff=1

This will disable your touchpad during the whole session, as long as you don’t type:

synclient TouchpadOff=0

It gets really boring to constantly turn it off when you type, and back on again when you want to use your pointer.

Fortunately, syndaemon comes to the rescue.

syndaemon is a program that monitor your keyboard activity and disable your touchpad when your keyboard is active.

There is a few options you can pass to syndaemon: the time your keyboard must have been idled for before turning your touchpad back on, if weither or not you want to only disable tapping and scrolling, or if you want to start syndaemon as a daemon or not.

The default parameters will disable completely your touchpad while typing and reactivate it after 2 seconds of inactivity. Typing in a terminal:

syndaemon

will automatically turn your touchpad off when you type and turn it back on once you have been inactive on your keyboard for 2 seconds. Using the -i switch, you will be able to tune the idle time.

syndaemon -i 1.0

will reactivate your touchpad after 1 seconds.

syndaemon -i 1.0 -t

Will simply deactivate scrolling and tapping but leave your mouse pointer active even if you type on your keyboard.

People who want to start syndaemon automatically when login in by using ~/.xinitrc should make sure that the -d switch is turn on. -d stands for daemon and will make syndaemon starts in background.