In almost all the large modern Linux distributions and in the last releases of Ubuntu-based distributions the touchpad was configured out of the box to have right, left and middle clicks and you could configure them easily. The middle click is usually done with a two or three-finger tap.
In Ubuntu 12.04 I haven't seen where to enable the middle click and it is not enabled by default.
You can make it work and persist in Ubuntu 12.04, even afer suspending, following these steps.
First, create a file with your script:
(You could place the script in another directory, e.g.
/etc, if you wanted it to be in a more "generic" place, in case you have multiple accounts in your ubuntu installation.)
Then make it executable:
And finally, run the following command replacing "user" with your user name:
Then reboot, or logout & login, or restart GNOME.
For more information about this fix, go here.