The Problem
It’s been years since I’ve used a laptop that actually had a middle mouse button, and it can be tricky getting the timing right to press the left and right touchpad buttons simultaneously to fake a middle button press. Happily, there’s a really simple way to turn a two-finger tap on the touchpad into a middle button click. This guide assumes that you are familiar with command line and scripting basics.
Make the Script
- Create the file touchpad_settings.sh, with these contents, then chmod +x it to make it executable.
#!/bin/bash synclient TapButton2=2
Tell Unity to Run the Script
- Run the Startup Applications program in Unity.
- Click Add
- For Name, type “mouse fix”
- For Command, provide the full pathname of touchpad_settings.sh
- For Comment, type “touchpad two-finger tap as middle mouse button” in case you forget why you put this here in the first place.
- Click Add.
- Click Close.
Run it
- The script will execute each time you log in, but to save yourself a logout/login cycle, you can just run it directly in your shell.
References