How do I disable touchpad when using a mouse

Solution 1:

On Gnome-based distros, you should be able to disable the touchpad, if an external mouse is connected, by the command:

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

To get the current situation:

gsettings get org.gnome.desktop.peripherals.touchpad send-events

Options are:

enabled
disabled
disabled-on-external-mouse

Solution 2:

There is also a program which introduces some GUI to edit some such settings.

sudo add-apt-repository ppa:atareao/atareao
sudo apt update
sudo apt install touchpad-indicator

Read a more detailed instruction set at https://itsfoss.com/disable-touchpad-when-mouse-used/