Definitely not the only way, but one way to do it would be to install gpointing-device-settings
and check the "Disable while any other devices are connected" checkbox in the "General" tab for your touchpad.
GUI solution
Install the package gpointing-device-settings
Description-en: configuration tool for pointing devices
GUI tool for setting pointing devices. Currently it can configure mouse type
device (mouse, trackpoint etc.) and touchpads.
.
For mouse you can configure middle button emulation, wheel emulation and
scrolling.
.
It can enable and disable touchpad, or scrolling on it as well as additional
parameters like palm detection, locked drags, tapping and scrolling.
.
It is a successor of GSynaptics.
Console/terminal solution #1
Alternatively, try this:
gsettings set org.gnome.settings-daemon.peripherals.mouse middle-button-enabled true
The alternative solution might require the installation of gnome-settings-daemon
package.
Console/terminal solution(s) #2
Using synclient
command you can view your synaptics touchpad options.
Run synclient
and see what variables you have available.
You can set/change the synclient options using this command: syclient var=1
(where var is the variable you wish to change and 1 the value)
Read the manual page about each variable: http://manpages.ubuntu.com/synaptics
What worked for me
Instead of figuring out how to press both buttons of the touchpad, keep/press two fingers on the touchpad and click on the left click button of the touchpad with a third finger. This emulates a middle button by default.
What worked for the original poster
a) Setting the TapButton variable works for the two fingered tap
b) If you still want to click both buttons and produce a middle button emulation, execute:
synclient EmulateMidButtonTime=100
EmulateMidButtonTime allows you to change the time required to produce a middle button (allowed time period to click both buttons). 100 means 100 milliseconds (ms).
You may set it to even higher values, such as synclient EmulateMidButtonTime=500
(500ms).
Best Answer
I use below command for that purpose
Where m stands for setting the "mouse" and the first integer represents the "acceleration", and the second represents the "threshold".
The acceleration can be specified as an integer, or as a simple fraction, but the threshold is just an integer.
The pointer will go
acceleration
times as fast when the device travels more thanthreshold
mickeys in 10 ms, including a small transition range.For more information, you can refer to the xset manual.