Touchpad, disable it while typing or when a mouse is connected

about touchpad

In the next article we will take a look at how we can disable the touchpad of our laptop while writing or when connecting an external mouse. The Dconf editor that we can use in GNOME offers several options for the mouse and the touchpad. From there we can also disable the touch panel permanently.

Even though there is no direct option in the Ubuntu operating system settings to disable the laptop’s touchpad while using an external mouse, or to disable the touchpad while typing, a couple of possibilities can be found to enable these 2 possibilities. Although it must be said that for the instructions to work, it will be necessary to use the GNOME Shell desktop and libinput.

Automatically disable the touchpad when a mouse is connected

In order to disable the touchpad when connecting an external mouse and re-enable the touchpad when disconnected, we can use the Dconf editor, or we can also use a command in the terminal.

From Dconf

The program Dconf Editor can be easily installed from the Ubuntu software option.

install dconf

Keep in mind that once we enable the option to disable the touchpad while using a mouse, the touchpad settings will no longer be available.

Related article:

How to disable the touchpad when we use the mouse in Ubuntu 17.10

If we open the Dconf editor, we can deactivate the mouse integrated in the laptop when we connect an external mouse. We will only have to head to the route / org / gnome / desktop / peripherals / touchpad.

dconf touchpad

Once there, we will have to Click on send-events and disable the option Use the default value. Then we will have to choose ‘disabled-on-external-mouse‘as custom value. To finish, all you have to do is click on the button Apply. This sits at the bottom of the Dconf Editor window, and appears after making any changes.

disable external mouse

If you want to reverse this, simply re-enable the option “Use the default value.

From the terminal

It also can disable the touchpad when an external mouse is connected by typing the following command in a terminal (Ctrl + Alt + T):

disable touchad from terminal

gsettings set org.gnome.desktop.peripherals.touchpad send-events disabled-on-external-mouse

In case you want undo the changes produced by the previous command, you can use the command:

gsettings set org.gnome.desktop.peripherals.touchpad send-events enabled

Using Touchpad-Indicator

If the above option does not work, as it appears that it does not work with all laptops and all mice, you can try to use Touchpad-Indicator like alternative, which is available in a PPA for Ubuntu / Linux Mint.

Touchpad-Indicator will allow us to disable the touch panel when a mouse is connected to the computer, but it offers some other functions, such as the possibility of enabling or disabling it from the menu, and enabling or disabling the touch panel when the application starts or is closes.

In order to access the Touchpad-Indicator icon from the GNOME Shell panel, it will be necessary to have the extension installed KStatusNotifierItem / AppIndicator Support or similar.

Also there is a GNOME Shell extension Touchpad-Indicator (in its description it is mentioned that it is compatible with GNOME Shell 3.36 and earlier), which attempts to accomplish the same thing. Although it is not compatible with Wayland.

Disable the touchpad while we write

Disabling the touchpad as we type is another option that is not directly available in the GNOME Shell system settings. But this can be enabled using the GNOME Tweaks application.

The option to disable the touchpad while writing is available at the settings that we can find in the option Keyboard and mouse. There we should find the section Touchpad, and just below is the option “Disable when typing.

disable when typing touchpad

You can also disable the mouse built into the laptop using Dconf Editor. This option is found in / org / gnome / desktop / peripherals / touchpad / disable-while-typing.

disable when writing from dconf

Another possibility to achieve this will be open a terminal (Ctrl + Alt + T) and use the command:

gsettings set org.gnome.desktop.peripherals.touchpad disable-while-typing true

In case you want reverse the effects of this command and do not disable the touchpad while typing, the command to use would be:

gsettings set org.gnome.desktop.peripherals.touchpad disable-while-typing false

Everything seen in these lines I have found published in Linuxuprising. And as I have found something really useful to be able to work with a laptop, without the touchpad moving the mouse pointer, it is also published here.

Add Comment