Home Linux Automatically Disable Touchpad When External Mouse Is Connected In Ubuntu
Automatically Disable Touchpad When External Mouse Is Connected In Ubuntu

Automatically Disable Touchpad When External Mouse Is Connected In Ubuntu

By sk
961 Views

I am not comfortable working with Touchpad of my Laptop. So I bought an external USB mouse. One minor problem I face often is my palm accidentally touches the touchpad and messes up with my writing when I type something. Sometimes, I accidentally close the application. This is very annoying and It happened a couple times. I could easily disable the Touchpad from the Settings in my Ubuntu desktop, but I didn't want to do it. I wanted an easy and reliable way to automatically disable Touchpad when external Mouse is connected in Ubuntu desktop. After a quick Google search, I found the following methods to disable Touchpad or other pointing devices when an external mouse is plugged in. Even though this guide is specifically written for Ubuntu, some of these methods might work on other Linux distributions as well.

Automatically Disable Touchpad When External Mouse Is Connected In Ubuntu

I tested these methods on Ubuntu 18.04 LTS desktop and they worked just  fine. If you're ever wanted to disable the touchpad when a Mouse is connected, one of these methods will definitely help.

Method 1 - Using Touchpad Indicator utility

Touchpad Indicator is small, graphical utility that will help you to configure Touchpad.

The developer of this tool has created a PPA to make the installation much easier! Open your Terminal and run the following commands to install Touchpad Indicator on your Ubuntu system.

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

Once Touchpad Indicator is installed, launch it from Menu or application launcher. It will create a little applet icon on your panel (taskbar).

Touch indicator applet icon

Touch indicator applet icon

Just click on it, choose Preferences. Under the Actions tab, enable the option that says "Disable touchpad when mouse plugged".

Disable touchpad when mouse plugged using Touchpad indicator

Disable touchpad when external mouse is connected using Touchpad indicator

Click OK and close the application. From now on, whenever you plug in an external mouse, the touchpad will be automatically disabled.

It is also recommended to start it automatically on every reboot, so you need not to manually start Touchpad indicator each time. To do so, go to "General options" tab and enable "Autostart" option.

Autostart Touchpad indicator

Autostart Touchpad indicator

Like I already mentioned, we can do a couple more things using this tool as listed below.

  • Enable/disable Touchpad,
  • Disable Touchpad while typing,
  • Enable/disable natural scrolling,
  • Enable/disable tapping,
  • Adjust Touchpad speed,
  • Enable/disable two finger scrolling,
  • Enable/disable edge scrolling,
  • Disable Touchpad when an external mouse is plugged in.

Some of you might want to disable Touchpad while you are typing. If so, go to Actions tab and enable "Disable touchpad on typing" option.

For more details, check the following guide:

To configure scrolling, tapping and touchpad speed etc., go to "Touchpad configuration" tab and enable/disable the respective option.

Toucpad configuration

Toucpad configuration

Touchpad Indicator is simple, fully functional and useful tool to configure Touchpad in whichever way you please. This tool is recommended for newbies and those who prefer GUI over CLI in general.

This method will work on any DEs. The following methods for GNOME DE only.

Method 2 - Using gsettings command

gsettings is a commandline interface to GSettings which allows us to get, set or monitor an individual key for changes.

This is the easiest and straight-forward method I could find. All you have to do is just copy/paste the below command to disable Touchpad.

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

This command will immediately disable the Touchpad if an external mouse is plugged in.

To enabled it back, simply do:

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

You can view the current setting using command:

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

Suggested read:


Method 3 - Using dconf-editor

This is just the graphical way of above method. In the previous method, we disabled Touchpad from command line. Now we will do the same using a graphical tool named "dconf". It is a simple configuration system designed for storing desktop environment settings. The main purpose of this tool is to provide a backend to GSettings on platforms that don't already have configuration storage systems. You can tweak various settings from "dconf" using a graphical editor called "dconf-editor".

To install dconf-editor, run the following command from your Terminal:

$ sudo apt install dconf-editor

Once installed, launch it by typing the following command from the Terminal. You can also launch it from Dash.

$ dconf-editor

At first launch, you will the following warning message. Click "I'll be careful" button to continue.

Launch dconf-editor

From the main interface, search for "Touchpad". Click on the "/org/gnome/desktop/peripherals/touchpad/" folder.

Search for touchpad in dconf-editor

Search for "touchpad" in dconf-editor

In the next window, click "Send-events" tab.

Click on the "Custom value" drop-down box at the end and choose "disabled-on-external-mouse" option.

Disable touchpad using dconf-editor

Disable touchpad using dconf-editor

Finally, click the tick mark at the far right end to save the settings and close dconf-editor.

Done! Now the touchpad will be automatically disabled once you connect the external mouse.


Related read:


These are the three different methods that I know to disable Touchpad when an external mouse is connected in Ubuntu-like systems. Use whichever method works for you. Good luck!

Resources:

Thanks for stopping by!

Help us to help you:

Have a Good day!!

You May Also Like

2 comments

Fabian Luttman May 15, 2020 - 3:57 am

Hello,
None of these methods work in Ubuntu Mate 20.04.
Any suggestions?
Thanks!

Reply
sk May 15, 2020 - 11:29 am

I am using Ubuntu 20.04 GNOME LTS desktop and gconf method works fine without any issues.I don’t have any MATE DEs right now, so I can’t comment.

Reply

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More