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?
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?
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.
~/.profile
to auto apply after reboots: xinput | grep 'ELAN Touchscreen' | grep -Po 'id=\d+' | cut -d= -f2 | xargs xinput disable
– TalkLittle
Sep 10 '16 at 19:50
xinput enable \
xinput | grep Atmel | sed "s/^.id=([0-9]).*$/\1/"``. Command inside What does backticks return the id.
– Pablo Bianchi
Mar 11 '17 at 15:53
xinput | grep "SYNAPTICS Synaptics Large Touch Screen" | awk '{match($0,"id=([0-9]+)",matches)}END{print matches[1]}' | xargs xinput disable
– olfek
Mar 06 '19 at 12:58
xinput disable $(xinput list --id-only "[Entire touch device name]")
– Stephen Angelico
Dec 15 '19 at 08:25
xinput disable \
xinput --list | grep -i 'touch ' | sed 's/id=//g' | cut -f2``
– rubo77
Jul 09 '20 at 16:20
book:~$ xinput
⎡ Virtual core pointer id=2 [master pointer (3)]
...
⎜ ↳ ATML1000:00 03EB:8A7F id=14 [slave pointer (2)]
...
⎜ ↳ ALP0013:00 044E:120A Touchpad id=17 [slave pointer (2)]
...
⎣ Virtual core key...
book:~$ xinput disable 14
book:~$ xinput disable 17
As you see the device 14 has NO Description, it came very handy to disable the touchpad, because sometimes during typing it reacts to input...
– ant0nwax Oct 24 '22 at 07:31The xinput
solution did not work for me. I instead followed the instructions in this thread. This will disable it at boot time.
/usr/share/X11/xorg.conf.d/10-evdev.conf
Option "Ignore" "on"
to the end of the section with the touchscreen
identifierELAN Touchscreen
in xinput
./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!
– Oli Beatson
Oct 22 '17 at 12:40
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.
Option = ignore
from the answer, as it doesn't disable the device just not doesn't treat it as a touch screen.
– matt wilkie
Jan 12 '18 at 18:46
/usr/share/X11/xorg.conf.d/40-libinput.conf
– Fed
Dec 07 '20 at 11:34
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).
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 @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: 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) & 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
$ 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: