63

I have a touchscreen, but the drivers are not working properly and interfere with my mouse.

Is it possible to disable my touchscreen , so that I can work again properly?

2
  • 1
    I have the same problem although the touchscreen is working perfectly, but the reason is my old year old touching on the screen while I try to work :) Commented Jun 29, 2020 at 5:40
  • Related: I added an answer to disable the trackpad on Ubuntu 22.04 from the command-line here: How to enable/disable the touchpad in Ubuntu 22.04 from the command-line Commented Dec 20, 2022 at 18:39

8 Answers 8

86

You can try disabling the input device with the xinput command. First see what input devices you have, just type:

xinput

And you should see a list like:

$ xinput 
⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Atmel Atmel maXTouch Digitizer            id=9    [slave  pointer  (2)]
⎜   ↳ TPPS/2 IBM TrackPoint                     id=13   [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                id=12   [slave  pointer  (2)]
...

Then you can disable the input device you want with this command:

xinput disable 9

Where 9 is the id of the device you want to disable. You can also use the device name between quotes.

In xinput version 1.5.99.1 , you need to do xinput set-prop 9 'Device Enabled' 0 instead. Oddly on xinput v1.6.2 the first way work.

11
  • 3
    This works on my lenovo yoga (2012) running ubuntu 14.04. Commented Apr 28, 2016 at 21:11
  • 13
    Works on Dell XPS 13 running Ubuntu 16.04. I also added this to ~/.profile to auto apply after reboots: xinput | grep 'ELAN Touchscreen' | grep -Po 'id=\d+' | cut -d= -f2 | xargs xinput disable Commented Sep 10, 2016 at 19:50
  • Atmel also seems pretty common, an alternative way as @TalkLittle: xinput enable `xinput | grep Atmel | sed "s/^.*id=\([0-9]*\).*$/\1/"`. Command inside What does backticks return the id. Commented Mar 11, 2017 at 15:53
  • Thank you. works on dell inspiron 13 7000 series running Ubuntu 16.10 Commented Aug 2, 2017 at 6:51
  • This is a gt on reat option. I prefer a way to turn i Commented Jul 22, 2018 at 20:59
39

The xinput solution did not work for me. I instead followed the instructions in this thread. This will disable it at boot time.

  1. Edit /usr/share/X11/xorg.conf.d/10-evdev.conf
  2. Add Option "Ignore" "on" to the end of the section with the touchscreen identifier
  3. Reboot

enter image description here

  • For the record (Google), I have a Samsung Series 7 and my touch screen was listed as ELAN Touchscreen in xinput.
  • JFTR too, in this question says the power consumption difference is mostly negligible.
11
  • 2
    I did that on a Dell XPS and it disabled the screen completely. After booting the screen is just black. Booted in recovery mode, removed the line and everything went back to normal. Commented Jan 6, 2016 at 15:46
  • 1
    This prevented my laptop for rebooting into X windows. Not a big deal to remove that setting, but something newbies want to check they can do before trying it. Commented Mar 2, 2016 at 17:28
  • 2
    Also disabled the touchpad on my Sony Vaio. Setting the driver value to "libinput" did the trick though Commented Mar 9, 2017 at 22:26
  • 7
    On Ubuntu 17.10, I couldn't find the file you listed but there was /usr/share/X11/xorg.conf.d/40-libinput.conf. I changed a similar block in this file and at next restart I guess I'll find out how it went! Commented Oct 22, 2017 at 12:40
  • 1
    @Oli Beatson';s worked for me Ubuntu 20..04 Ryzen 5 AMD . cracked screen. touchpad is ok . Commented Dec 8, 2021 at 3:56
8

Edit file the file with

sudo nano /usr/share/X11/xorg.conf.d/10-evdev.conf

Change MatchIsTouchscreen from "on" to "off" in the Touchscreen section so it looks like this:

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

Save, Name and Exit

Touchscreen is disabled and no longer detected in xinput list.

5
  • This worked on my Lenovo ideacentre Flex 20, which had a cracked screen. Commented Aug 5, 2017 at 23:59
  • This worked for Dell XPS 15 and Linux Mint 18. I think this is safer than using Option = ignore from the answer, as it doesn't disable the device just not doesn't treat it as a touch screen. Commented Jan 12, 2018 at 18:46
  • This isn't working anymore. I updated to Ubuntu 18.04, and the 10-evdev.conf file is gone. I tried recreating it, but it didn't work. Commented May 8, 2018 at 0:09
  • @Merlin04 Did you check the libinput file? There is an answer that mentions this: askubuntu.com/a/1038259/167115 Commented Aug 6, 2019 at 8:33
  • 2
    For me, on linux mint the file to edit was /usr/share/X11/xorg.conf.d/40-libinput.conf Commented Dec 7, 2020 at 11:34
4

In order to disable the touchscreen on Ubuntu 19.x and 20.x you can:

  • Wait the login screen
  • Press Alt+F2
  • Edit the "libinput" configuration and disable the touchscreen section, like that:
sudo nano /usr/share/X11/xorg.conf.d/40-libinput.conf 
# Match on all types of devices but joysticks
#
# If you want to configure your devices, do not copy this file.
# Instead, use a config snippet that contains something like this:
#
# Section "InputClass"
#   Identifier "something or other"
#   MatchDriver "libinput"
#
#   MatchIsTouchpad "on"
#   ... other Match directives ...
#   Option "someoption" "value"
# EndSection
#
# This applies the option any libinput device also matched by the other
# directives. See the xorg.conf(5) man page for more info on
# matching devices.

Section "InputClass"
        Identifier "libinput pointer catchall"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Section "InputClass"
        Identifier "libinput keyboard catchall"
        MatchIsKeyboard "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Section "InputClass"
        Identifier "libinput touchpad catchall"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

#Section "InputClass"                               <----
#        Identifier "libinput touchscreen catchall" <---- this one
#        MatchIsTouchscreen "on"                    <---- put # in
#        MatchDevicePath "/dev/input/event*"        <---- front of
#        Driver "libinput"                          <---- every line
#EndSection                                         <----   

Section "InputClass"
        Identifier "libinput tablet catchall"
        MatchIsTablet "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

My "Dell Inspiron" touchscreen was broken. The cursor moved all over the place and click in random places several times a second. I was unable even to make login on the gnome or even to access the bios.

2
  • You sir are a goddam hero and deserve way more upvotes. I had exactly the same issue as you; perhaps not quite to the same extent, but the cursor would go nuts, moving erratically, clicking stuff, the on-screen keyboard would flash up, with keys pressed... etc. Nightmare. Would happen completely randomly and sporadically as well, with whole days passing with it being fine, and then the issue suddenly appearing again and persisting even after reboots and reinstalling drivers. Anyway... THIS was the solution. Completely fixed it. Thank you..! Commented May 13, 2024 at 10:14
  • Just to mention, I'm also on Dell; an XPS 17, and running Pop!_OS 22.04. Commented May 13, 2024 at 10:14
2

As id for xinput changes on reboot, I added a simple one-line screen on session load:

#!/bin/bash
xinput --list | awk '/Atmel Atmel maXTouch Digitizer/ {print $7}' | awk '{split($0,a,"="); print a[2]}' | xargs xinput disable

My device's name is "Atmel Atmel maXTouch Digitizer", change that with your device (use xinput --list for device name).

0

If your touchscreen is a touch panel screen like a USB monitor, you can add default kernel driver usbtouchscreen into modprobe's blacklist file (/etc/modprobe.d/blacklist.conf) and use your custom driver such as touchkit or evtouch.

0

As @romaia's answer here shows, xinput is indeed the right way to do it.

However, I like to write a script and attach calling this script to a Ctrl + Alt + P keyboard shortcut, to make this super easy. Now I get an auto-closing window like this when I use this shortcut the first time:

enter image description here

...and if I use the shortcut again:

enter image description here

Ah, beautiful! Now I can easily enable/disable my touchpad or touchscreen, and fix mouse scroll speed, all with a single easy-to-use keyboard shortcut!

Get the latest version of this script here: https://github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles/blob/master/toggle_touchpad.sh.

Here's a snapshot of it at this moment:

#!/bin/bash

# This file is part of eRCaGuy_dotfiles: https://github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles

# toggle_touchpad.sh
# - toggle the touchpad & touchscreen on and off, and enable/disable imwheel to fix scroll speed when using a mouse
#   instead of the touchpad

# Gabriel Staples
# Started: 2 Apr. 2018 
# Update History (newest on TOP): 
#   28 Jan. 2020 - added in lines to disable Touchscreen too, as well as show ID numbers of 
#                  Touchscreen & Touchpad
#   22 June 2019 - added in the imwheel stuff to not mess up track pad scrolling when
#                  track pad is in use

# References (in order of progression):
# 1. negusp described xinput: https://askubuntu.com/questions/844151/enable-disable-touchpad/844218#844218
# 2. Almas Dusal does some fancy sed stuff & turns negusp's answer into a script: https://askubuntu.com/questions/844151/enable-disable-touchpad/874865#874865
# 3. I turn it into a beter script, attach it to a Ctrl + Alt + P shortcut, & do a zenity GUI popup window as well:
#    https://askubuntu.com/questions/844151/enable-disable-touchpad/1109515#1109515
# 4. I add imwheel to my script to also fix Chrome mouse scroll wheel speed problem at the same time:
#    https://askubuntu.com/questions/254367/permanently-fix-chrome-scroll-speed/991680#991680
# 5. I put this script on Github, and posted a snapshot of it on this answer here: 
#    https://askubuntu.com/questions/198572/how-do-i-disable-the-touchscreen-drivers/1206493#1206493 

# `xinput` search strings for these devices
# - Manually run `xinput` on your PC, look at the output, and adjust these search strings as necessary for your 
#   particular hardware and machine!
TOUCHPAD_STR="TouchPad"
TOUCHSCREEN_STR="Touchscreen"

read TouchpadId <<< $( xinput | sed -nre "/${TOUCHPAD_STR}/s/.*id=([0-9]*).*/\1/p" )
read TouchscreenId <<< $( xinput | sed -nre "/${TOUCHSCREEN_STR}/s/.*id=([0-9]*).*/\1/p" )
echo "TouchpadId = $TouchpadId" # Debug print
echo "TouchscreenId = $TouchscreenId" # Debug print

state=$( xinput list-props "$TouchpadId" | grep "Device Enabled" | grep -o "[01]$" )

PRINT_TEXT="Touchpad (ID $TouchpadId) &amp; Touchscreen (ID $TouchscreenId) "
if [ "$state" -eq '1' ];then
    imwheel -b "4 5" # helps mouse wheel scroll speed be better
    xinput --disable "$TouchpadId"
    xinput --disable "$TouchscreenId"
    zenity --info --text "${PRINT_TEXT} DISABLED" --timeout=2
else
    killall imwheel # helps track pad scrolling not be messed up by imwheel
    xinput --enable "$TouchpadId"
    xinput --enable "$TouchscreenId"
    zenity --info --text "${PRINT_TEXT} ENABLED" --timeout=2
fi

References (in order of progression):

  1. negusp described xinput: Enable/disable touchpad
  2. Almas Dusal does some fancy sed stuff & turns negusp's answer into a script: Enable/disable touchpad
  3. I turn it into a beter script, attach it to a Ctrl + Alt + P shortcut, & do a zenity GUI popup window as well: Enable/disable touchpad
  4. I add imwheel to my script to also fix Chrome mouse scroll wheel speed problem at the same time: Permanently fix Chrome scroll speed
  5. I put this script on Github, and posted a snapshot of it on this answer here: How do I disable the touchscreen drivers?
  6. Get the latest version of this script here! https://github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles/blob/master/toggle_touchpad.sh
0

In order to disable the touchscreen on Ubuntu (Xorg or Xwayland) you can:

  • Wait the login screen;
  • Press Alt+F3 to open a console;
  • Find the correct device id
  • Edit /etc/rc.local to disable the touchscreen device;
  • Make /etc/rc.local executable and reboot.
$ cd /sys/bus/hid/drivers/hid-multitouch
$ ls -1
  0003:2A94:5241.0006         <- my touchscreen
  0018:06CB:7621.0001         <- my touchpad
  bind
  (...)

then, test it:

$ sudo bash
$ cd /sys/bus/hid/drivers/hid-multitouch
$ echo "0003:2A94:5241.0006" > unbind
$ killall -9 Xorg

Setup rc.local to disable it on startup:

$ sudo nano /etc/rc.local
  #!/bin/sh
  ls -1 /sys/bus/hid/drivers/hid-multitouch | grep 0003:2A94:5241 > /sys/bus/hid/drivers/hid-multitouch/unbind
$ sudo chmod +x /etc.rc.local
$ reboot

I did this way because:

  • It doesn’t break my other multitouch devices;
  • It is simpler and works on Xorg and Xwayland;
  • The last 4 digits of the device change often on boot, therefore, I needed a solution that locate the correct device based on a simple rule;
  • My Dell Inspiron 5557 touchscreen is broken in such a way that I can’t access the bios or use a graphics environment, therefore, I needed a console solution.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.