Ubuntu – How to disable the TouchPad on a laptop, but keep mouse buttons active

lenovomousetouchpad

I want to disable the touchpad of my Lenovo x240. If I use the settings GUI the mouse buttons get disabled, too.

How can I disable the touchpad mouse cursor movement, and keep the mouse buttons active?

Related, but I want to disable mouse movements completely:

Drivers for Lenovo Thinkpad S540 Touchpad (erratic mouse cursor)

I use Ubuntu 14.04 with xserver-xorg-input-synaptics version 1.7.4

Best Answer

Open gedit and copy-paste the following lines into it:

#!/bin/sh
# This script disables the touchpad without disabling buttons by setting Hysteresis
# to an impossible value.

############
# Warning! #
############
# If you have a touchpad with no "Physical" buttons but have to tap the corners 
# of your touchpad to simulate physical buttons, put a "#" sign in front of the next
# 4 lines!

synclient LTCornerButton=1
#synclient LBCornerButton=0
synclient RTCornerButton=3
#synclient RBCornerButton=0


# Set PalmDetect on: Needed if the before lines are commented away,
# Doesn't do any harm if they're not
synclient PalmDetect=1

synclient HorizHysteresis=10000 
synclient VertHysteresis=10000

# Disable all other touchpad features
synclient VertEdgeScroll=0
synclient HorizEdgeScroll=0
synclient CornerCoasting=0
synclient VertTwoFingerScroll=0
synclient HorizTwoFingerScroll=0
synclient TouchpadOff=2
synclient LockedDrags=0
synclient TapButton1=0
synclient TapButton2=0
synclient TapButton3=0
synclient CircularPad=0

Then save it as /usr/local/bin/DisableTouchPad.sh

In a terminal type:

chmod a+xr /usr/local/bin/DisableTouchPad.sh

To activate it type:

DisableTouchPad.sh

and test whether this works.

To make this change permanent, go to the dash, open "Startup Applications", click add, in the command type: /usr/local/bin/DisableTouchPad.sh and in the Name and Comment type anything that will remind you what this was about. Click add again.

Presto: a disabled touchpad with the buttons still enabled!