3

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?

deshmukh
  • 4,061

3 Answers3

3

As a complement to the other answers.


UPDATED SOLUTION:

My initial post is the one after this update. But I find the solution in this answer more reliable, while mine involves using variables that can change over time and require restarting the procedure.

Instead of the xinput commands mentioned below I therefore recommend synclient commands that do not involve such variables.

That may need:

sudo apt install xserver-xorg-input-synaptics

(which requires restart)

So I would also recommend replacing xinput with synclient commands in the desktop launchers indicated below.


Find the number of your touchpad with

xinput list

Example with ID 16:

Create the following desktop files and save them:

kate ~.local/share/applications/disable_touchpad.desktop

Containing:

[Desktop Entry]
Name=Disable touchpad
Comment=Set your mouse and touchpad preferences
Exec=xinput --disable 16 
Icon=/usr/share/icons/breeze/status/22/input-touchpad-off.svg
Terminal=false
Type=Application
StartupNotify=true
Categories=GNOME;GTK;Settings;HardwareSettings;X-GNOME-Settings-Panel;System;

And:

kate ~/.local/share/applications/enable_touchpad.desktop

Containing:

[Desktop Entry]
Name=Enable touchpad
Comment=Set your mouse and touchpad preferences
Exec=xinput --enable 16 
Icon=/usr/share/icons/breeze/status/22/input-touchpad-on.svg
Terminal=false
Type=Application
StartupNotify=true
Categories=GNOME;GTK;Settings;HardwareSettings;X-GNOME-Settings-Panel;System;

Then, using runner:

enter image description here

  • Instead of using the number of the device, one can use its name, which won't change, right? if so - is the synclient option still preferable? – Ur Ya'ar Nov 08 '21 at 19:20
2

In Lubuntu (18.04 LTS with LXDE as well as Cosmic with LXQt), I use

synclient touchpadoff=1

You may prefer

synclient touchpadoff=2

and enable the touchpad with

synclient touchpadoff=0

See man synaptics

   Option "TouchpadOff" "integer"
          Switch off the touchpad.  Valid values are:

          0   Touchpad is enabled
          1   Touchpad is switched off (physical clicks still work)
          2   Only tapping and scrolling is switched off
          When  the  touchpad  is  switched off, button events caused by a
          physical button press are still interpreted. On a ClickPad, this
          includes  software-emulated  middle and right buttons as defined
          by the SoftButtonAreas setting.

   Property: "Synaptics Off"

You can make an alias or aliases in order to run these actions in a more convenient way.

sudodus
  • 46,324
  • 5
  • 88
  • 152
  • Thanks. But how can I get the expected behavior i.e. automatically turning touchpad on when the keyboard is not being used and vice versa? – deshmukh Aug 02 '18 at 03:25
  • @deshmukh. I am not using that behaviour (automatically turning touchpad on when the keyboard is not being used and vice versa), and I don't know how to set the computer for it. Let us hope that somebody who knows will chip in and help you. – sudodus Aug 02 '18 at 06:26
  • @deshmukh. Have you seen this link about Touchpad Indicator? I am not sure if it works in 18.04 LTS, but maybe you can try it. – sudodus Aug 02 '18 at 06:32
  • @deshmukh - I have always found the option "disable while typing" very unreliable in the desktops environments when it is present. What happens is that the touchpad is not disabled in time or that it is enabled between touching the keyboard keys, or when it is inadvertently touched.And therefore I find the manual on/off action more reliable. –  Nov 15 '18 at 13:26
  • 1
    The above may need sudo apt install xserver-xorg-input-synaptics, then restart. It is more reliable that what I have initially posted myself (using xinput) in that the ID for xinput may be changed without notice (and lead to the keyboard being instead disabled etc). –  Nov 15 '18 at 13:27
1

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.
Hi-Angel
  • 3,702
  • 1
  • 29
  • 36
  • for some reason I have the disable while writing prop set to 1, but it still doesn't work... Using Fedora LXQt on Asus T100 – Ur Ya'ar Nov 08 '21 at 19:23