Wednesday, April 22, 2020

Disabling touchscreeen on Ubuntu / Xubuntu

For temporarily disabling, touchscreen will be enabled after re-login, first we should identify touchscreen id. For this run following command in terminal:

xinput --list

It will show like this:

Virtual core pointer                    id=2 [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              id=4 [slave  pointer  (2)]
⎜   ↳ SYN1B7F:00 06CB:7DA2 Touchpad            id=17 [slave  pointer  (2)]
⎣   ↳ Xyz Touchscreen            id=9 [slave  pointer  (2)] 
Virtual core keyboard                    id=3 [master keyboard (2)]
    ↳ Virtual core XTEST keyboard              id=5 [slave  keyboard (3)]
    ↳ Video Bus                                id=6 [slave  keyboard (3)]
    ↳ Power Button                            id=7 [slave  keyboard (3)]
    ↳ Lid Switch                              id=8 [slave  keyboard (3)]
    ↳ HDA Intel PCH Front Headphone            id=10 [slave  keyboard (3)]
    ↳ HDA Intel PCH HDMI/DP,pcm=3              id=11 [slave  keyboard (3)]
    ↳ HDA Intel PCH HDMI/DP,pcm=7              id=12 [slave  keyboard (3)]
    ↳ HDA Intel PCH HDMI/DP,pcm=8              id=13 [slave  keyboard (3)]
    ↳ HDA Intel PCH HDMI/DP,pcm=9              id=14 [slave  keyboard (3)]
    ↳ HDA Intel PCH HDMI/DP,pcm=10            id=15 [slave  keyboard (3)]
    ↳ HD WebCam: HD WebCam                    id=16 [slave  keyboard (3)]
    ↳ Intel Virtual Button driver              id=18 [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard            id=19 [slave  keyboard (3)]
    ↳ Acer WMI hotkeys                        id=20 [slave  keyboard (3)]

From above it is clear that touchscreen id is 9

For disabling touchscreen, use command:

xinput disable 9

For enabling touchscreen, use command:

xinput enable 9

In the above procedure re-login will enable touchscreen. For permanent disabling, we have to edit the file /usr/share/X11/xorg.conf.d/40-libinput.conf. for this run command

sudo gedit  /usr/share/X11/xorg.conf.d/40-libinput.conf

or for xubuntu

sudo nano /usr/share/X11/xorg.conf.d/40-libinput.conf

This file will have entry like


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


Change MatchIsTouchscreen "on" to MatchIsTouchscreen "off" like this

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

Save the file. Now touch screen is permanetly disabled

No comments: