0

I disabled the touchpad on my Dell XPS 13 to work around a bug (the mouse cursor jumps around randomly as I type, selects text, etc.), possibly in 22.04, but the OS ignores it and the touchpad remains active.enter image description here

Why, you may ask, do I think disabling the touchpad would help? Because I noticed that as long as my hands are far enough away from the touchpad, the problem doesn't occur. So before I open up the laptop and pull the plug on the touchpad, I thought I'd check in here. Has anyone else experienced this in 22.04?

2 Answers2

2

Find the xinput ID for the touchpad

open a terminal and use the command:

xinput list

This will output something like this:

Virtual core pointer                        id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ SYNA30D2:00 06CB:CE08                     id=10   [slave  pointer  (2)]
⎜   ↳ SYNA30D2:00 06CB:CE08                     id=11   [slave  pointer  (2)]
⎜   ↳ SYNA30D2:00 06CB:CE08                     id=12   [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3    [master keyboard (2)]

For the next part, try all the ID numbers for the slave pointer to find out which is your touchpad. Mine works with id=12.

Test

Enter the command:

xinput set-prop N 'Device Enabled' 0    # Disable touchpad

Replace N with the number in id=. before entering the above command and then try the touchpad to see if it is disabled. If it does not work, use the command:

xinput set-prop N 'Device Enabled' 1    # Enable touchpad

This command will enable the device disabled by the previous command. Note which N disables the touchpad.

Script

Save the script below as /home/$USER/bin/touchtoggle.

#!/bin/bash
# Purpose: Toggles the touchpad on and off with keyboard shortcut Ctrl+Z
# set via System settings > Keyboard > keyboard Shortcuts > Custom

Change the ID below to your touchpad ID

ID=12

TOGGLE=$HOME/.touchpadtoggle

if [ ! -e $TOGGLE ]; then touch $TOGGLE xinput set-prop $ID 'Device Enabled' 0 # Disable touchpad else rm $TOGGLE xinput set-prop $ID 'Device Enabled' 1 # Enable touchpad fi exit 0

Use your file manager to set the script executable, or use the terminal and enter:

chmod +x /home/$USER/bin/touchtoggle

Check if the script works as expected by running it from the terminal by typing:

touchtoggle

Shortcut

If it works assign a keyboard shortcut like Ctrl+Z, or something similar in System settings > Keyboard > keyboard Shortcuts: View and Customize Shortcuts > Custom Shortcuts. Enter the following:

  • Name: Toggle touchpad on and off
  • Command: /home/$USER/bin/touchtoggle
  • Shotcut: Press the shortcut you want

Change $USER to your username.

Hope this helps

user68186
  • 33,360
  • 1
    Thanks for the suggestion; you made my day! In fact, it was device ID, the Touchpad pointer, that needed disabling: ruomini@ruomini-XPS-13-9370:~$ xinput list ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ DELL07E6:00 06CB:76AF Touchpad id=14 [slave pointer (2)] ⎜ ↳ PS/2 Generic Mouse id=19 [slave pointer (2)] ⎜ ↳ Bluetooth Mouse M336/M337/M535 Mouse id=22 [slave pointer (2)] – FractalBob Oct 04 '22 at 15:43
1

Rather than fully disabling the touchpad, disabling only "Tap to click" will be of equal help to you. The setting is in "Settings", "Mouse & Touchpad". The touchpad remains functional, clicking however now must be done by pressing the touchpad mechanically down.

Personally, I can quickly toggle the setting on or off by hitting Ctrl+Esc. This is effectuated by a small script triggered by that shortcut key. Here is how in case you are interested:

1. Create the script

Using a text editor, copy following script into a file ~/.local/bin/toggletouchpad. If the directory ~/.local/bin does not yet exist, create it then log out and back in so it gets included in your search PATH.

#!/bin/bash
STATUS=$(gsettings get org.gnome.desktop.peripherals.touchpad tap-to-click)
case $STATUS in
    true )
        gsettings set org.gnome.desktop.peripherals.touchpad tap-to-click false
    ;;
    false )
        gsettings set org.gnome.desktop.peripherals.touchpad tap-to-click true
    ;;
esac

2. Make the script executable

Use your file manager to set the script executable, or use the terminal: chmod +x ~/.local/bin/toggletouchpad

3. Assign it to a shortcut key

Add a shortcut key in "Settings" - "Keyboard", "Keyboard Shortcuts". As "command", fill in toggletouchpad.

vanadium
  • 88,010
  • Thanks, but that didn't help. I think the problem is that there's a capacitive coupling between my hands and the touchpad, so even if OS obeyed the Disable Tap to click (which it doesn't in my case), it wouldn't help. – FractalBob Oct 03 '22 at 16:08
  • So disabling tap to click in the Settings also has no effect for you? – vanadium Oct 03 '22 at 16:13
  • This is a more elegant solution than my answer. It works for me. I can move the cursor all the time. The keyboard shortcut toggles tap-to-click on and off. – user68186 Oct 03 '22 at 20:48
  • @user68186 more elegant and easier. However, both your approach (turning touchpad of as OP wanted) and my approach (disable Tap to click) may not work for OP, considering his comment. – vanadium Oct 04 '22 at 09:34