How do I enable Middle mouse button emulation in 12.04 LTS?

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.

gpointing-device-settings middle mouse button emulation

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.

  1. Run synclient and see what variables you have available.

  2. 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).


With Ubuntu 17 and in XFCE the middle mouse button copy paste did not work at all.

Same issue still in Ubuntu 20.x.

Solution

To enable the middle mouse button paste function edit the xinput.

  1. Query your device:

     xinput list
    

Identify your mouse. With me it was device number 10.

  1. xinput list-props 10 gives me the settings for the mouse.

  2. I need to change the value for "libinput Middle Emulation Enabled (294):" and I need to do it as root:

     xinput set-prop 10 "libinput Middle Emulation Enabled" 1
    
  3. Check if the value changed to 1:

     xinput list-props 10
    

Yes, it works: "libinput Middle Emulation Enabled (294): 1"

In a recent Ubuntu 20.x connecting a Logitech Marble Mouse with 2 buttons (old, white model) gave me "libinput Middle Emulation Enabled (292): 0" and I changed it accordingly.

In Ubuntu 18 and XFCE there is a significant change: NO LONGER "libinput Button Middle". Instead "Evdev Third Button Emulation". So the whole line is now (for my machine):

sudo xinput set-prop 10 "Evdev Third Button Emulation" 1 

To make it persistent, add a line in ~/.xstartup!
In my case it just looks the same like before:

xinput set-prop 10 "libinput Middle Emulation Enabled" 1

That makes it effective from start on.

HINT: If yor flavour or surface of Linux GUI does not support xinput you might get a little error line each time you open a terminal.

Better solutions are always welcome :-)

This is what is behind it.

I strongly disagree that Ubuntu and Gnome decided to disable the standard Unix Middle Mouse paste. Even in XFCE Ubuntu 17 it is devastated. May the managers behind this decision find a soon and painful end. You make my life hard.

Many, many thanks to Gilles who found the solution!!!

I had the same issues using Ubuntu 16, 14.10 and earlier: Unix style copy paste in the terminal not working. Disappointing default settings. However, here is a solution (partly a wrap up of other peoples great work):

  • To fix the terminal issue I successfully put the following lines into my xorg.conf:

(see if /etc/X11/xorg.conf is suitable for you. May be different for Lubuntu etc.)

Section "InputClass"
    Identifier "middle button emulation class"
    MatchIsPointer "on"
    Option "Emulate3Buttons" "on"
EndSection
  • The very anoying malfunction of a missing 3rd mouse button (touch pad, Marble Mouse) can actually be fixed with the "gpointing-device-settings". Just install using CLI with:

    apt-get install gpointing-device-settings

Then invoke gpointing-device-settings to get the gui window. Remark: There is an unfixed bug in newer Ubuntus that wipes out your settings when rebooting. You may put gpointing-device-settings in auto-start but still need to prompt then. I am not aware of any proper config solution.

Probably some steps need a sudo or root access. I assume you know.

However, now I can use the unixish copy paste by mark and middle mouse button. At least in terminal. And for the Marble Mouse there is a separate article with a lot of config details.

Addendum

With Ubuntu 17 and in XFCE the middle mouse button copy paste did not work at all.

Wayland is different.

Sometimes it is helpful to enter

gsettings set org.gnome.settings-daemon.peripherals.mouse middle-button-enabled true

With some luck it is persistent. Else try to create a start script.


You can also set the middle mouse button on a triple-finger-tap by calling

synclient TapButton3=2

(Put this in a script and add it to your startup programs)

It is strange, cause there seems to have been a bugreport, that supposed to have been fixed.

source: enable a three finger tap on my synaptic touchpad: