Posts Tagged: syndaemon


23
Aug 09

Disable the touchpad whilst typing on the Asus EeePC 1005HA in Ubuntu

If you install Ubuntu Netbook Remix 9.04 (UNR) on the Asus EeePC 1005HA you do get most features supported out of the box, however there are a couple of things that require a bit of tweaking such as the ethernet and wireless drivers and some of the function keys and touchpad. For a full-on guide to setting up your machine with Ubuntu, head over to this excellent blog post.

Disable the touchpad whilst typing
One thing that I did not feel was configured properly in the above guide is the touchpad for the 1005HA. On such a small laptop, it is inevitable that whilst typing emails or doing word processing tasks on the netbook, your hands will often brush the touchpad, activating tapping or scrolling features that may cause undesired outcomes such as text being deleted or being moved around within the document. This problem can however be dealt with by using a program that temporarily deactivates the touchpad whilst text is being typed and then reactivates it once typing is finished. Whilst this feature is discussed in the above guide, there is no documentation regarding customisation – for example users may want to change the amount of time for which the touchpad is disabled or only disable tapping and scrolling (and not the pointer itself). I did some investigation on my own and found the following solution:

Configuring the touchpad device
Before we do anything else, we need to enable configuration of the touchpad by enabling SHMConfig in a configuration file. In a terminal, enter the following commands:

sudo nano /etc/hal/fdi/policy/shmconfig.fdi

Paste the following code into the file and save:

<?xml version="1.0" encoding="UTF-8"?><deviceinfo version="0.2"><device><match key="input.x11_driver" string="synaptics"><merge key="input.x11_options.SHMConfig" type="string">True</merge></match></device></deviceinfo>

You now need to restart X (logout and log back in again) or restart the computer for changes to take effect.

Syndaemon – disable the touchpad on typing
Next, we will use syndaemon to setup automatic disabling of the touchpad when typing. Here are the configuration options for this daemon.

Usage: syndaemon [-i idle-time] [-m poll-delay] [-d] [-t] [-k]
  -i How many seconds to wait after the last key press before
     enabling the touchpad. (default is 2.0s)
  -m How many milli-seconds to wait until next poll.
     (default is 200ms)
  -d Start as a daemon, ie in the background.
  -p Create a pid file with the specified name.
  -t Only disable tapping and scrolling, not mouse movements.
  -k Ignore modifier keys when monitoring keyboard activity.
  -K Like -k but also ignore Modifier+Key combos.
  -S Use SHMConfig even if input device properties are available.

It is best to setup syndaemon to run as a daemon process in the background – if you run it as a normal command in a terminal then it will terminate when you quit the terminal session. Here is the command I use to run syndaemon:

syndaemon -t -K -d -i 1

The -t flag only disables tapping and scrolling whilst typing. This is useful as it means that you can continue to move the mouse pointer whilst or immediately after typing – but you will not accidentally click on text or scroll within a window whilst you are typing when your hands brush against the touchpad.

The -K flag means that the touchpad will only be deactivated when you are typing real text and not when you are using shortcut keys within programs.

Finally, I personally prefer a slightly shorter time delay of just one second before the touchpad is reactivated, this is set by the -i flag followed by the delay time in seconds.

Automation
Instead of running this manually in a terminal every time you need it, you can setup syndaemon to run automatically on session startup. In the menu, go to System –> Preferences –> Startup Programs and add an entry named “Syndaemon”. You can then copy and paste the above command into the dialogue box and hit ok.