[Solved] How to disable the touchpad when the mouse is plugged in?

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
User avatar
APSchmidt
Level 3
Level 3
Posts: 129
Joined: Mon Jul 13, 2020 5:25 am

[Solved] How to disable the touchpad when the mouse is plugged in?

Post by APSchmidt »

... and re-enable it when the mouse is unplugged.

There is not apparent setting about that in the Linux Mint Mouse and Touchpad settings.

How to you do that? Is there a secure application I could use? Just using console commands would suit me.

Thank you. :)
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
wallyUSA
Level 6
Level 6
Posts: 1439
Joined: Thu Jun 08, 2017 2:31 pm
Location: Top of Georgia

Re: How to disable the touchpad when the mouse is plugged in?

Post by wallyUSA »

Look in system settings, mouse & touchpad:
touchpad.jpg
> If your query has been resolved, edit your original post and add <SOLVED> to the beginning of the subject line. This may help others find solutions. <

Dell Latitude 7490 Mint 21.3 Ker 5.15.0-105 Cinn 6.0.4
User avatar
APSchmidt
Level 3
Level 3
Posts: 129
Joined: Mon Jul 13, 2020 5:25 am

Re: How to disable the touchpad when the mouse is plugged in?

Post by APSchmidt »

wallyUSA wrote: Sat Jul 25, 2020 6:24 amLook in system settings, mouse & touchpad: ...
In System settings and not in Mouse and Touchpad settings? Oh well..

Thank you. :)
User avatar
wallyUSA
Level 6
Level 6
Posts: 1439
Joined: Thu Jun 08, 2017 2:31 pm
Location: Top of Georgia

Re: How to disable the touchpad when the mouse is plugged in?

Post by wallyUSA »

APSchmidt wrote: Sat Jul 25, 2020 6:50 am
In System settings and not in Mouse and Touchpad settings? Oh well..

Thank you. :)
This is LM 20 Cinnamon. May be in diff location for you. What version & desktop are you using?
> If your query has been resolved, edit your original post and add <SOLVED> to the beginning of the subject line. This may help others find solutions. <

Dell Latitude 7490 Mint 21.3 Ker 5.15.0-105 Cinn 6.0.4
User avatar
APSchmidt
Level 3
Level 3
Posts: 129
Joined: Mon Jul 13, 2020 5:25 am

Re: How to disable the touchpad when the mouse is plugged in?

Post by APSchmidt »

wallyUSA wrote: Sat Jul 25, 2020 7:41 am This is LM 20 Cinnamon. May be in diff location for you. What version & desktop are you using?
I'm using Xfce.
User avatar
wallyUSA
Level 6
Level 6
Posts: 1439
Joined: Thu Jun 08, 2017 2:31 pm
Location: Top of Georgia

Re: How to disable the touchpad when the mouse is plugged in?

Post by wallyUSA »

APSchmidt wrote: Sat Jul 25, 2020 9:19 am
wallyUSA wrote: Sat Jul 25, 2020 7:41 am This is LM 20 Cinnamon. May be in diff location for you. What version & desktop are you using?
I'm using Xfce.
I am sure an Xfce person will help you. There must be something similar in Xfce :?:
> If your query has been resolved, edit your original post and add <SOLVED> to the beginning of the subject line. This may help others find solutions. <

Dell Latitude 7490 Mint 21.3 Ker 5.15.0-105 Cinn 6.0.4
User avatar
Dark Owl
Level 5
Level 5
Posts: 553
Joined: Sat May 02, 2020 7:43 am
Location: Brit

Re: How to disable the touchpad when the mouse is plugged in?

Post by Dark Owl »

APSchmidt wrote: Sat Jul 25, 2020 6:50 am
wallyUSA wrote: Sat Jul 25, 2020 6:24 amLook in system settings, mouse & touchpad: ...
In System settings and not in Mouse and Touchpad settings? Oh well..

Thank you. :)
There's a lot of apparent inconsistency like that! What would be a logical place for some isn't necessarily the logical place for the implementers.

For what it's worth: I have never tried automatically disabling the trackpad on my Win7 notebook - it seems simple enough simply not to use it, and if I really want to disable the trackpad there's a button for that.
Currently: Linux Mint 21.2 Cinnamon 64-bit 5.8.4, AMD Ryzen5 + Geforce GT 710
Previously: LM20.3 LM20.2 LM20.1, LM20, LM20β, LM18.2
User avatar
APSchmidt
Level 3
Level 3
Posts: 129
Joined: Mon Jul 13, 2020 5:25 am

Re: How to disable the touchpad when the mouse is plugged in?

Post by APSchmidt »

wallyUSA wrote: Sat Jul 25, 2020 6:24 am Look in system settings, mouse & touchpad:
After taking a closer look, I can confirm that there is no such setting in Xfce Mouse and Touchpad settings.
michael-hi
Level 4
Level 4
Posts: 302
Joined: Sun Mar 19, 2017 2:31 pm

Re: How to disable the touchpad when the mouse is plugged in?

Post by michael-hi »

In Xfce there used to be a tick-box option in the touchpad settings to disable the touchpad while typing, but even that seems to have disappeared in a brand-new install using the libinput touchpad driver. It seems that setting is now enabled by default anyway, although it only stops the touchpad while you are actually tapping the keyboard. I'm not aware of any setting you can access to disable it while the mouse is plugged in.

But as Dark Owl points out, laptops usually have a button to turn the touchpad on and off. In the case of my Lenovo laptop it is the F6 key. I should think the simplest option would be to tap the equivalent key on your laptop when you plug in the mouse and again when you remove it.

If you are particularly keen to have some sort of command to do this, you could look at the "Removable Drives and Media" settings. There is a tab for Input Devices on which you could put a command to be run automatically whenever a USB mouse is connected. I suppose it wouldn't make anything happen when you remove the mouse, but that may not be a problem if you would be switching the laptop off then anyway.

Finally, there is a little program called touchpad-indicator which would do what you want:
https://launchpad.net/~atareao/+archive ... lter=focal

I haven't installed the PPA but I did download the .deb file from this page and tried it out on a Live USB version of Mint 20. It seems to work OK with my wireless mouse but I'm not really sure it's worth downloading unofficial software from an external source to do this.
User avatar
antikythera
Level 15
Level 15
Posts: 5721
Joined: Thu Jul 02, 2020 12:52 pm
Location: Cymru

Re: How to disable the touchpad when the mouse is plugged in?

Post by antikythera »

You may want to try this. I can't guarantee it will work (it did with Manjaro GNOME) but it is worth a shot. The change is not desktop environment specific, it will work with any X11 session utilising the libinput driver.

With sudo rights create a file called /etc/X11/Xsession.d/30-touchpad.conf

Code: Select all

sudo nano /etc/X11/Xsession.d/30-touchpad.conf
Add the following:

Code: Select all

Section "InputClass"
    Identifier "touchpad"
    Driver "libinput"
    MatchIsTouchpad "on"
    Option "SendEventsMode" "disabled-on-external-mouse"
EndSection
Save the change (CTRL+O followed by Enter), close nano (CTRL+X) and restart. Try it, plug in a mouse and the touchpad should be voided, unplug the mouse and it should work again. If you use a wireless device, then that means unplug the receiver too.

https://wayland.freedesktop.org/libinpu ... vents-mode
Last edited by antikythera on Sat Jul 25, 2020 8:20 pm, edited 5 times in total.
I’ll tell you a DNS joke but be advised, it could take up to 24 hours for everyone to get it.
User avatar
Lady Fitzgerald
Level 15
Level 15
Posts: 5819
Joined: Tue Jan 07, 2020 3:12 pm
Location: AZ, SSA (Squabbling States of America)

Re: How to disable the touchpad when the mouse is plugged in?

Post by Lady Fitzgerald »

antikythera wrote: Sat Jul 25, 2020 4:01 pm...If you use a wireless device, then that means unplug the receiver too...
I had always wished to be able to disable a touchpad when a mouse was present on my Lenovo notebooks when on Win 7 but couldn't because Lenovo didn't have the feature; I couldn't even just permanently disable it period (mutter, mutter, mumble, mumble). I had to manually shut off the miserable, misbegotten, despicable, stupid touchpad every time I booted up . One thing I like, no, make that love, about Linux Mint is the ability to set the touchpad to be always off.

I use wireless mice (mouses, meece, meeces?) on my machines. When I saw this thread, I checked out the setting to disable the touchpad and discovered I had to remove the receiver, not just turn off the mouse. Still, pulling the receiver on the incredibly rare occasions I may want to use the abomination...er...touchpad instead of the mouse is far more convenient than trying to reenable the idiot touchpad when using the mouse to do so is inconvenient.

Did I mention I do not like touchpads?
Jeannie

To ensure the safety of your data, you have to be proactive, not reactive, so, back it up!
User avatar
antikythera
Level 15
Level 15
Posts: 5721
Joined: Thu Jul 02, 2020 12:52 pm
Location: Cymru

Re: How to disable the touchpad when the mouse is plugged in?

Post by antikythera »

Nope, I can't remember you mentioning that :lol:

I don't like them either, I use a Logitech M570 because it is easier for me to control than a normal mouse and can be used on anything. I had a TrackMan Wheel for years before that but the micro-switches wore out on it.
I’ll tell you a DNS joke but be advised, it could take up to 24 hours for everyone to get it.
User avatar
APSchmidt
Level 3
Level 3
Posts: 129
Joined: Mon Jul 13, 2020 5:25 am

Re: How to disable the touchpad when the mouse is plugged in?

Post by APSchmidt »

antikythera wrote: Sat Jul 25, 2020 4:01 pm With sudo rights create a file called /etc/X11/XSession.d/30-touchpad.conf

Code: Select all

sudo nano /etc/X11/XSession.d/30-touchpad.conf
Hi,

I'm trying your solution but when I save I get an error message saying that the file doesn't exist...
User avatar
antikythera
Level 15
Level 15
Posts: 5721
Joined: Thu Jul 02, 2020 12:52 pm
Location: Cymru

Re: How to disable the touchpad when the mouse is plugged in?

Post by antikythera »

there's a typo, I will edit the above. Thanks for trying it though and feeding back:

Code: Select all

sudo nano /etc/X11/Xsession.d/30-touchpad.conf
The error is about the directory, nano will create the new file no problems as long as it is pointed the right way :)
I’ll tell you a DNS joke but be advised, it could take up to 24 hours for everyone to get it.
User avatar
APSchmidt
Level 3
Level 3
Posts: 129
Joined: Mon Jul 13, 2020 5:25 am

Re: How to disable the touchpad when the mouse is plugged in?

Post by APSchmidt »

antikythera wrote: Sat Jul 25, 2020 8:17 pm there's a typo, I will edit the above. Thanks for trying it though and feeding back:

Code: Select all

sudo nano /etc/X11/Xsession.d/30-touchpad.conf
The error is about the directory, nano will create the new file no problems as long as it is pointed the right way :)
Ah... :)

This time it worked. I'll see the result next time I boot. Thank you!
User avatar
Lady Fitzgerald
Level 15
Level 15
Posts: 5819
Joined: Tue Jan 07, 2020 3:12 pm
Location: AZ, SSA (Squabbling States of America)

Re: How to disable the touchpad when the mouse is plugged in?

Post by Lady Fitzgerald »

antikythera wrote: Sat Jul 25, 2020 6:25 pm Nope, I can't remember you mentioning that :lol:

I don't like them either, I use a Logitech M570 because it is easier for me to control than a normal mouse and can be used on anything. I had a TrackMan Wheel for years before that but the micro-switches wore out on it.
My weapon...er...wireless mouse of choice is the Logitech M525. It's the perfect size for my hand. I have a herd of the little buggers (around 10 or 11).
Jeannie

To ensure the safety of your data, you have to be proactive, not reactive, so, back it up!
User avatar
Dark Owl
Level 5
Level 5
Posts: 553
Joined: Sat May 02, 2020 7:43 am
Location: Brit

Re: How to disable the touchpad when the mouse is plugged in?

Post by Dark Owl »

Lady Fitzgerald wrote: Sat Jul 25, 2020 6:17 pm
antikythera wrote: Sat Jul 25, 2020 4:01 pm...If you use a wireless device, then that means unplug the receiver too...
Still, pulling the receiver on the incredibly rare occasions I may want to use the abomination...er...touchpad instead of the mouse is far more convenient than trying to reenable the idiot touchpad when using the mouse to do so is inconvenient.
I use a Bluetooth mouse (but not on my Mint system) - maybe just turning off the mouse (hence it being "off line" to its driver) would achieve the same effect. All wireless mice are equal, but some are more equal than others.

Lady Fitzgerald wrote: Sat Jul 25, 2020 6:17 pmDid I mention I do not like touchpads?
Maybe the touchpad can be disabled in the BIOS?
Currently: Linux Mint 21.2 Cinnamon 64-bit 5.8.4, AMD Ryzen5 + Geforce GT 710
Previously: LM20.3 LM20.2 LM20.1, LM20, LM20β, LM18.2
User avatar
antikythera
Level 15
Level 15
Posts: 5721
Joined: Thu Jul 02, 2020 12:52 pm
Location: Cymru

Re: How to disable the touchpad when the mouse is plugged in?

Post by antikythera »

The Logitech unified receiver is also detected as a HID in it's own right, so no it doesn't work just turning off a Logitech device to enable the touchpad. As for other brands, I guess it is worth a try just turning the device off if it has an on/off switch and leaving the receiver in. Worst case scenario, they find out they have to pull the receiver out anyway ;)
I’ll tell you a DNS joke but be advised, it could take up to 24 hours for everyone to get it.
User avatar
APSchmidt
Level 3
Level 3
Posts: 129
Joined: Mon Jul 13, 2020 5:25 am

Re: How to disable the touchpad when the mouse is plugged in?

Post by APSchmidt »

antikythera wrote: Sat Jul 25, 2020 4:01 pm You may want to try this. I can't guarantee it will work (it did with Manjaro GNOME) but it is worth a shot. The change is not desktop environment specific, it will work with any X11 session utilising the libinput driver.

With sudo rights create a file called /etc/X11/Xsession.d/30-touchpad.conf

Code: Select all

sudo nano /etc/X11/Xsession.d/30-touchpad.conf
Add the following:

Code: Select all

Section "InputClass"
    Identifier "touchpad"
    Driver "libinput"
    MatchIsTouchpad "on"
    Option "SendEventsMode" "disabled-on-external-mouse"
EndSection
So, I tried this and it doesn't work...
User avatar
antikythera
Level 15
Level 15
Posts: 5721
Joined: Thu Jul 02, 2020 12:52 pm
Location: Cymru

Re: How to disable the touchpad when the mouse is plugged in?

Post by antikythera »

Okay, since it didn't work you can safely delete the created file. It is possible to set the SendEventsMode value using dconf editor (use the searchbox in dconf editor to go straight to it). That may work better for Ubuntu based systems.
I’ll tell you a DNS joke but be advised, it could take up to 24 hours for everyone to get it.
Locked

Return to “Other topics”