How To Auto-Disable The Touchpad When The Mouse Is Plugged In (Fedora 13)

Brief how-to will help others, this issue has been bugging me for years. I want the same capability in Fedora that exists in most recent versions of Windows — disable the touchpad on my laptop if an external mouse is plugged in. Note that my how-to is a little hardware-specific regarding the actual disabling of the touchpad; I’ll discuss that more at the end of the guide.

For my OS (Fedora 13 x86_64) and hardware (Dell Precision M4500) – I needed a specific utility and three scripts. This Dell’s trackpad and nipple-stick are seen as an ‘internal’ PS/2 mouse by Fedora, so I had to install ‘xinput’ to disable it (and use a very arcane little command-line)

# yum -y install xorg-x11-apps

The enable/disable commands may be different for different hardware … I had to use some xinput commands to figure out the values I needed

$ xinput list
$ xinput list-props "PS/2 Generic Mouse"

Device ‘PS/2 Generic Mouse’:
Device Enabled (119): 1

This told me that I could use the following:

to disable touchpad:

xinput --set-prop "PS/2 Generic Mouse" "Device Enabled" 0

to enable touchpad

xinput --set-prop "PS/2 Generic Mouse" "Device Enabled" 1

Addendum

Get udev environment info for the touchpad

udevadm info --query=all --name=/dev/input/mouse1

Testing specific udev rules

# udevadm test --action=add /sys/devices/platform/i8042/serio1/input/input6/mouse1 2>&1 | grep "run:"

udevadm_test: run: ‘/bin/sh -c ‘DISPLAY=:0 /usr/bin/xinput –set-prop PS/2\ Generic\ Mouse Device\ Enabled 0”
udevadm_test: run: ‘socket:@/org/freedesktop/hal/udev_event’

# udevadm test --action=remove /sys/devices/platform/i8042/serio1/input/input6/mouse1 2>&1 | grep "run:"

udevadm_test: run: ‘/bin/sh -c ‘DISPLAY=:0 /usr/bin/xinput –set-prop PS/2\ Generic\ Mouse Device\ Enabled 1”
udevadm_test: run: ‘socket:@/org/freedesktop/hal/udev_event’

Leave a comment