I found a way to do this:
First, open a terminal, and print out all input devices to find the id you need for the input device you want to disable. In terminal, type:
xinput --list
Next: Notice where it says id=X in one long column for every input device. You want to find the device id that corresponds to the input device you want to disable (Maybe something that sounds like "touchpad"). Then replace X in the following command with the id number representing the input device you want to disable:
xinput disable X
Note: If you're not sure which device id you should use to disable the touchpad, then you can find out by testing random id's and seeing if your mouse pad still works. Make sure you are NOT DOING ANYTHING IMPORTANT. Save all your work and be prepared to restart your computer if you do something like disable your keyboard. (You may have trouble trying to enable it again if you can't type into the terminal.
Then you'll have to run this last line (Thanks for catching this Arch Stanton!)
xinput enable X
Reason: I desperately needed an answer to this problem because the problems I was experiencing with my touchpad made doing any kind of work impossible. Suddenly, at some random moment when using my laptop, for apparently no reason, my touchpad goes into some kind of "special mode". Merely moving one finger on my touchpad would cause the screen to scroll, instead of actually moving the cursor of the mouse on the screen so it was impossible to get the mouse to hover over anything in broswer without considerable coordinating efforts to account for the scrolling screen and non moving mouse. I wanted to find a way, WITHOUT RESTARTING THE LAPTOP, to reset the touchpad. On the plus side, resetting the touchpad with the method above actually fixes my problem.
Update:
To make resetting the touchpad even easier, I made a hotkey for the above listed commands. When my touchpad goes on the fritz, I simply do the key combination ctrl+super+r and it does the reset for me. Quick and easy.
Here's how:
-Create a file inside your home directory and call it something like "touchpad-reset.sh".
-Inside this file, put in two of the three (the last two) previous commands listed above except, instead of using an X id number for the device, since it's subject to change with added peripherals (maybe??) you can do use this instead:
Here's an output from my computer inside the terminal using this commmand:
xinput --list
Result:
Virtual core pointer id=2 [master pointer (3)]⎜
↳ Virtual core XTEST pointer id=4 [slave pointer (2)]⎜
↳ Genius 2.4G Wireless Mouse id=10 [slave pointer (2)]⎜
↳ MSFT0001:00 06CB:75BD UNKNOWN id=13 [slave pointer (2)]⎜
↳ ELAN Touchscreen id=12 [slave pointer (2)]⎜
-Now what you do, you replace the X (which was an id before) for xinput disable X and xinput enable X with the name corresponding to that id inside single quotes. For example, from the above, if you wanted to do it for id=13, my touchpad device, you would use:
xinput disable 'MSFT0001:00 06CB:75BD UNKNOWN'
xinput enable 'MSFT0001:00 06CB:75BD UNKNOWN'
-So now, you're disabling by name instead of ID number, where an id may possibly change in time and then you'd be disabling and enabling some other device.
Finally, you need to give the permissions to make this file executable; run this command with your working directory in the terminal as your home directory (where you created the file):
chmod +x your_script_name.sh
So once you make this file with the appropriate commands written inside, making sure it's in your home directory, take the following steps below:
- Press the super key (windows key on PC) on keyboard to bring up the unity side bar. Type in 'system settings' and press the enter key.
- Find the 'Keyboard' option under where it says 'Hardware' and click on it.
- Select the 'Shortcuts' tab.
- In the left window, select 'Custom Shortcuts'
- Click on the + button near the bottom center.
- A window should pop up asking for a description name and a command to put in.
- Make the name something like "reset touchpad"
- Use this command: gnome-terminal -x ./name_of_your_script.sh
- Click on 'Apply'
- You should now see your shortcut listed and on the far right it should say "Disabled" or some other garbage. Click on that text and be prepared to make some kind of key combination, perhaps like ctrl+super+r.
- Once you make this key combination, you're done.
Congrats! Have fun.