Trackpads on laptops are annoying if you’re using a mouse. While typing, you can accidentally tap it, causing the cursor to move.
Change your /etc/X11/xorg.conf file so the Synaptics Touchpad input device section looks like this:
Section "InputDevice"
Identifier "Synaptics Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "HorizScrollDelta" "0"
Option "SHMConfig"
EndSection
The important line is the
Option "SHMConfig"
line.
After restarting X, you can disable the touchpad with this command:
synclient TouchpadOff=1
It can be enabled with
synclient TouchpadOff=0
Mac OSX disabled the touch pad when you plug a mouse in. GNOME should do this. There is an open bug about it.
The following python programme will detect when a mouse is plugged in (using HAL/Dbus) and disable the touchpad using the above command when a mouse is plugged in. If you plug in more than one mouse, crazy things might happen. You’ll need the python dbus package. Dump this somewhere, make it executable and add it to your start up programmes.
#! /usr/bin/python
import os
import dbus, gobject
from dbus.mainloop.glib import DBusGMainLoop
DBusGMainLoop(set_as_default=True)
system_bus = dbus.SystemBus()
def device_removed(device_name):
global hal, initial_mice
mice = hal.FindDeviceByCapability("input.mouse")
# mice won't include the device that was removed, so we need to check
# initial_mice
if device_name in mice or device_name in initial_mice:
enable_trackpad()
def device_added(device_name):
global hal, initial_mice
mice = hal.FindDeviceByCapability("input.mouse")
if device_name in mice or device_name in initial_mice:
disable_trackpad()
def enable_trackpad():
os.system("synclient TouchpadOff=0")
def disable_trackpad():
os.system("synclient TouchpadOff=1")
system_bus.add_signal_receiver(
handler_function=device_removed,
signal_name="DeviceRemoved",
path="/org/freedesktop/Hal/Manager",
dbus_interface="org.freedesktop.Hal.Manager" )
system_bus.add_signal_receiver(
handler_function=device_added,
signal_name="DeviceAdded",
path="/org/freedesktop/Hal/Manager",
dbus_interface="org.freedesktop.Hal.Manager" )
hal = system_bus.get_object('org.freedesktop.Hal', '/org/freedesktop/Hal/Manager')
initial_mice = hal.FindDeviceByCapability("input.mouse")
# see how many mice we have when we start up.
if len(initial_mice) == 1:
# only one possible mouse so it's the trackpad.
enable_trackpad()
else:
disable_trackpad()
loop = gobject.MainLoop()
loop.run()