Ubuntu – Disable touchpad while typing in LXQt

lxqttouchpad

Runing LXQt on Kubuntu 18.04.

In the configuration, there is no option to disable touchpad while typing.

How do I get this done? Touchpad should be re-enabled after a small delay after the last keystroke?

Best Answer

I'm assuming you're using X11, not Wayland, because in the later only compositor can do this, so the functional needs to be added to LXQt settings.

You can alter this option through xinput app as follows:

  1. Find name of the touchpad in the list of available devices:

    $ xinput list                                                                
    ⎡ Virtual core pointer                          id=2    [master pointer  (3)]
    ⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
    ⎜   ↳ A4TECH USB Device                         id=10   [slave  pointer  (2)]
    ⎜   ↳ A4TECH USB Device                         id=11   [slave  pointer  (2)]
    ⎜   ↳ SEM USB Keyboard                          id=13   [slave  pointer  (2)]
    ⎜   ↳ DELL0768:00 06CB:7E92 Touchpad            id=15   [slave  pointer  (2)]
    ⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
        ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
        ↳ Power Button                              id=6    [slave  keyboard (3)]
        ↳ Video Bus                                 id=7    [slave  keyboard (3)]
        ↳ Power Button                              id=8    [slave  keyboard (3)]
        ↳ Sleep Button                              id=9    [slave  keyboard (3)]
        ↳ SEM USB Keyboard                          id=12   [slave  keyboard (3)]
        ↳ Integrated_Webcam_HD: Integrate           id=14   [slave  keyboard (3)]
        ↳ Dell WMI hotkeys                          id=16   [slave  keyboard (3)]
        ↳ AT Translated Set 2 keyboard              id=17   [slave  keyboard (3)]
        ↳ DELL Wireless hotkeys                     id=18   [slave  keyboard (3)]
        ↳ A4TECH USB Device                         id=19   [slave  keyboard (3)]
        ↳ SEM USB Keyboard                          id=20   [slave  keyboard (3)]
    
  2. List properties for the touchpad:

    $ xinput list-props "DELL0768:00 06CB:7E92 Touchpad"
    Device 'DELL0768:00 06CB:7E92 Touchpad':
            Device Enabled (148):   1
            Coordinate Transformation Matrix (150): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
            libinput Tapping Enabled (304): 1
            libinput Tapping Enabled Default (305): 0
            libinput Tapping Drag Enabled (306):    1
            libinput Tapping Drag Enabled Default (307):    1
            libinput Tapping Drag Lock Enabled (308):       0
            libinput Tapping Drag Lock Enabled Default (309):       0
            libinput Tapping Button Mapping Enabled (310):  1, 0
            libinput Tapping Button Mapping Default (311):  1, 0
            libinput Natural Scrolling Enabled (286):       0
            libinput Natural Scrolling Enabled Default (287):       0
            libinput Disable While Typing Enabled (312):    0
            libinput Disable While Typing Enabled Default (313):    1
            libinput Scroll Methods Available (290):        1, 1, 0
            libinput Scroll Method Enabled (291):   1, 0, 0
            libinput Scroll Method Enabled Default (292):   1, 0, 0
            libinput Click Methods Available (314): 1, 1
            libinput Click Method Enabled (315):    1, 0
            libinput Click Method Enabled Default (316):    1, 0
            libinput Middle Emulation Enabled (295):        0
            libinput Middle Emulation Enabled Default (296):        0
            libinput Accel Speed (297):     0.000000
            libinput Accel Speed Default (298):     0.000000
            libinput Left Handed Enabled (302):     0
            libinput Left Handed Enabled Default (303):     0
            libinput Send Events Modes Available (271):     1, 1
            libinput Send Events Mode Enabled (272):        0, 0
            libinput Send Events Mode Enabled Default (273):        0, 0
            Device Node (274):      "/dev/input/event13"
            Device Product ID (275):        1739, 32402
            libinput Drag Lock Buttons (288):       <no items>
            libinput Horizontal Scroll Enabled (289):       1
    
  3. Alter the "Disable While Typing Enabled" option:

    $ xinput set-prop "DELL0768:00 06CB:7E92 Touchpad" "libinput Disable While Typing Enabled" 1
    

You can add this command to autostart.


Side notes (optional):

  1. Alternatively, you could craft up an X11 settings file to do this, but IMO it's clunky and unobvious, I'd rather stick to the xinput-in-autostart method.
  2. You can replace full strings in the commands with ids of devices/options, but they tend to change, full strings are more robust.
  3. For consistency with your question I've disabled the option before running the commands. It's odd you have to enable this option, because libinput has it enabled by default, but oh well.
Related Question