Note: This tutorial works for the Xfce edition of Linux Mint and should not be relied upon for use with other desktop environments.
The problem: Accidentally brushing the touchpad on a laptop will cause the mouse pointer to re-focus to another area of the screen. If you’re typing when this happens, the text will be either placed in the wrong location or interrupted entirely.
The solution: Disable the laptop touchpad while typing.
Many desktop environments include a feature to turn the touchpad off while typing – Xfce includes this feature but it doesn’t work as expected. In order to make this feature work properly, I had to completely disable the touchpad.
Step 1: identify the touchpad device
The first thing we need to do is identify the device we will be working with and you can do that in XFCE by opening a terminal and running the following command:
Code: Select all
xinput list
Step 2: disabling the device
Using the xinput command again, I ran the following command:
Code: Select all
xinput set-prop 14 "Device Enabled" 0
After setting the “Device Enabled” state to “0”, the off state, I tried moving the mouse pointer using the touchpad and, sure enough, the mouse pointer didn’t move. So, I re-enabled the touchpad by running the following command:
Code: Select all
xinput set-prop 14 "Device Enabled" 1
Setting the “Device Enabled” state back to “1”, the on state, restored the functionality of the touchpad as expected. You can add those two commands to your ~/.bash_aliases file and run them at your leisure, but I went a step further and created keyboard shortcuts for the commands.
Using keyboard shortcuts to toggle touchpad functionality
Now that we have the proper commands to toggle the touchpad at our leisure, we can use those commands to create keyboard shortcuts.
Open the Settings app and click on the Keyboard icon in the Hardware section, we’re going to add two new commands. In the Keyboard settings window, click on the tab entitled Application Shortcuts. At the bottom of the Application Shortcuts tab click the button labeled “Add”. Enter the command below and click the OK button:
Code: Select all
xinput set-prop 14 "Device Enabled" 0
Code: Select all
xinput set-prop 14 "Device Enabled" 1
You should now see two new commands entered into the shortcuts list. Double-click each of those new commands and give them your preferred key sequence. I used Ctrl+Alt+0 for off and Ctrl+Alt+1 for on – it made sense to use “0” and “1” as those numbers are the binary equivalent of off and on. All you have to do now is perform the proper keyboard shortcuts to disable the touchpad when you want to type, or plug in a usb mouse, and then re-enable the touchpad when you want to use it.
You should now have keyboard shortcuts which will turn the touchpad off and on whenever the need arises.