How do I disable the TouchPad on a laptop, but keep mouse buttons active?

6,762

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!

Share:
6,762
guettli
Author by

guettli

http://thomas-guettler.de/ Working out loud: https://github.com/guettli/wol

Updated on September 18, 2022

Comments

  • guettli
    guettli over 1 year

    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

    • guettli
      guettli over 9 years
      The synclient parameters are documented here: x.org/archive/X11R7.5/doc/man/man4/synaptics.4.html
    • guettli
      guettli over 9 years
      Related: askubuntu.com/questions/370505/how-to-use-trackpoint-but-kee‌​p-touchpad-disabled-‌​on-lenovo-thinkpad-e‌​531
  • Rohith Madhavan
    Rohith Madhavan over 9 years
    This method will also disable the mouse buttons and hence is not useful. synclient TouchpadOff=0 can be used to achieve the same as above.
  • guettli
    guettli over 9 years
    @Philip I am sorry, your answer does not help. This disables the touchpad and the mouse buttons. The mouse buttons are just areas on the touchpad on the thinkpad x240. I ask myself how can anyone work with this device.. I use an external thinkpad keyboard now. But that's no good solution.
  • guettli
    guettli over 9 years
    I did synclient MinSpeed=0and synclient MaxSpeed=0 but nothing changes. The touchpad works like before.
  • guettli
    guettli over 9 years
    Here is the diff of synclient -l before and after your disable script. pastebin.com/zF9G8QLH
  • Fabby
    Fabby over 9 years
    that does not include the synclient Min and MaxSpeed above... (but it doesn't help anyway) Let me test an bit and I'll get back to you...
  • Fabby
    Fabby over 9 years
    OK. Here is one with the parameters your touchpad displays: To properly test, disable the script in the autostart, log out and log in again
  • Fabby
    Fabby over 9 years
    Please keep a mouse handy! Then type: synclient HorizHysteresis=10000 and synclient VertHysteresis=10000 report back
  • Fabby
    Fabby over 9 years
    The bounty period is over anyway, so you won't have to give your points to me... Upvoting my answer will at least give me some credit for all the work I put in here... :/
  • guettli
    guettli over 9 years
    thank you for your work. I up voted your answer and I updated it. The script was missing some "synclient" strings. The touchpad is disabled now, and one button works. But Middle- or RightButton still does not work. I looked at the launchpad site of the xserver-xorg-input-synaptics package. There are 40 open bugs. I guess it won't work with the the default version shipped with Ubuntu 14.04
  • Liso
    Liso over 6 years
    Thanks ! I got it working on my 16.04 box. Really need this feature :)