How to disable touchscreen permanently?

I am trying to disable the touchscreen on my Asus S200E laptop. In Ubuntu 16.04, I was able to do so with this:

Section "InputClass"
    Identifier "evdev touchscreen catchall"
    MatchIsTouchscreen "on"
    MatchDevicePath "/dev/input/event*"
    Driver "libinput"
EndSection

How can this be done on Ubuntu 18.04?


It appears that you are referring to files located at /usr/share/X11/xorg.conf.d. Perhaps the libinput driver was recently updated to support your touchscreen?

Probably you want to edit /usr/share/X11/xorg.conf.d/10-evdev.conf with:

Section "InputClass"
    Identifier "evdev touchscreen catchall"
    MatchIsTouchscreen "off"
    MatchDevicePath "/dev/input/event*"
    #Driver "evdev"
    Option "Ignore" "on"
EndSection

And /usr/share/X11/xorg.conf.d/40-libinput.conf with:

Section "InputClass"
    Identifier "libinput touchscreen catchall"
    MatchIsTouchscreen "off"
    MatchDevicePath "/dev/input/event*"
    #Driver "libinput"
    Option "Ignore" "on"
EndSection

Note: It's not necessary to make all of the changes. But it potentially saves you from having to go back to reedit files if one of the parameters changes or a bug causes one of them to be ignored.

Note: If only one of the files exist, try editing that one and see if it does what you need. If neither file exists, you may have to create them.


If that does not work (or you don't have permissions necessary to edit system files), get the name of your touchscreen with xinput and add one of the following commands to a startup script:

xinput set-prop [touchscreen name] "Device Enabled" 0
xinput disable [touchscreen name]

Although you can use device and property ids for testing, you should use the names in quotes when adding the commands to scripts. Device id can change between reboots, and property ids are not readable if you need to change the script later.