Home Linux Tips & Tricks Auto Disable Touchpad When Mouse Is Connected In GNOME

Auto Disable Touchpad When Mouse Is Connected In GNOME

By sk
606 Views

In this guide, I will show you how to auto disable touchpad when mouse is connected in GNOME Linux Laptops.

All Laptops have Touchpad, but not everyone is using it as their primary pointing device. Some users prefers Mouse over Touchpad. Because using a mouse is very convenient and much simpler than touchpad.

Also the location of touchpad makes it prone to accidental touching while you're typing. Sometimes, my palm or wrist accidentally touches the touchpad and moves the mouse cursor while typing. I often face this nuisance and it is quite annoying when I type something important and the cursor jumps all over the screen and messes with the writing.

One way to stop accidental touchpad touches while typing is to disable the touchpad only when you start to type. Once you stop typing, the touchpad will function as usual. When you start typing again, the touchpad will not work. Please note that the touchpad is not disabled permanently. It simply stops working when you are about to start type in your keyboard.

The another way to avoid accidental click while typing on your Laptop is to get an external mouse and automatically disable the touchpad when the mouse is connected. After you unplugged the mouse, the touchpad will work as usual.

In this tutorial, I will walk you through the steps to disable touchpad automatically when an external mouse is connected in GNOME Linux desktops. These methods should work on any Linux distribution that has GNOME desktop environment. I have tested this on Fedora 33, 34 and openSUSE tumbleweed. It worked fine as expected.

Auto Disable Touchpad When Mouse Is Connected In GNOME Desktops

We can disable the touchpad and prevent accidentally moving cursor while typing using gsettings and dconf-editor. First, we will see how to do it using gsettings.

1. Disable touchpad when mouse is connected using gsettings

This method is specifically for Linux distributions that is installed with GNOME DE.

To disable touchpad when the mouse is connected, run:

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

The touchpad will be immediately disabled once you run the above command.

You can view the current setting using command:

$ gsettings get org.gnome.desktop.peripherals.touchpad send-events
Disable touchpad when mouse is connected using gsettings
Disable touchpad when mouse is connected using gsettings

To enable the mouse again, run:

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

2. Disable touchpad when mouse is connected using dconf-editor

Dconf-editor is a graphical viewer and editor of applications internal settings. It allows editing options not exposed in some applications interface. Please careful while using this tool. If you don't know what you're doing, you probably will break your system.

Dconf-editor comes pre-installed with GNOME Linux distributions. Just in case it is missing for any reason, install dconf-editor using your default package manager.

To install dconf-editor on Arch Linux and its variants, run:

$ sudo pacman -S dconf-editor

On Debian, Ubuntu, POP_OS!:

$ sudo apt install dconf-editor

Fedora, RHEL:

$ sudo dnf install dconf-editor

openSUSE:

$ sudo zypper install dconf-editor

Launch dconf-editor from application menu or terminal by running the following command:

$ dconf-editor

You will see a warning message at first launch. Click "I'll be careful" button to continue.

Launch dconf-editor
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

Click on "send-events" option in the next window:

Open send-events option in dconf-editor
Open send-events option in dconf-editor

In the send-events section, click the "Custom value" drop down box and choose "disabled-on-external-mouse" option.

Disable touchpad when mouse is connected using dconf-editor
Disable touchpad when mouse is connected using dconf-editor

That's it. From now on, the touchpad will be automatically disabled as soon as you connect a mouse.

Hope this helps.

You May Also Like

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