How Do I Disable the Touchscreen Drivers?

How Do I Disable the Touchscreen Drivers?

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?

1

7 Answers

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.

10

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
  • 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

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

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.

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).

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.

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:

...and if I use the shortcut again:

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: .

Here's a snapshot of it at this moment:

#!/bin/bash

# This file is part of 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: 
# 2. Almas Dusal does some fancy sed stuff & turns negusp's answer into a script: 
# 3. I turn it into a beter script, attach it to a Ctrl + Alt + P shortcut, & do a zenity GUI popup window as well:
#    
# 4. I add imwheel to my script to also fix Chrome mouse scroll wheel speed problem at the same time:
#    
# 5. I put this script on Github, and posted a snapshot of it on this answer here: 
#     

# `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!
James H. Sterling
Author

James H. Sterling

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.