15

I was using the mouse copy-paste extensively, until recently, when some OpenSuSe upgrade reconfigured this on all my machines. Now the scrollbuton is the one to paste (which I hate, since it's hard to click without scrolling, and I also click it sometimes accidentally).

Where is this configured? Ideally I would love something that I can add to session start (for both Gnome and KDE).

4
  • It would be helpful if you could describe your desired behavior. If you don't want to use the scrollbutton to paste, what would you rather use? Mar 23, 2011 at 18:10
  • @Faheem Uhm, care to read the title? Mar 23, 2011 at 18:49
  • Oops. Mar 23, 2011 at 18:52
  • askubuntu.com/questions/160164/… answers this question with some noob friendly/GUI solutions. It doesn't require ubuntu, rather: gpointing-device-settings , gsettings or synclient
    – pd12
    Jun 7, 2015 at 6:21

5 Answers 5

25

You can set this property with xinput. Run xinput list to see the list of connected input devices. Note the exact name or the number of the device corresponding to your mouse (not the “Virtual core pointer”, but something like “Logitech USB-PS/2 Mouse M-BA47”). The name depends on your mouse model; I think the number is assigned dynamically, so you might need to do a bit of parsing to cope with multiple machines.

Then, run

xinput set-prop "$device_name_or_number" "Evdev Middle Button Emulation" 1

Run xinput list-props "$device_name_or_number" to see a list of available properties, the exact set is different on different systems.

While you're at it, you might want to tune other settings (run xinput list-props "$device_name_or_number" to see what settings exist). In particular, by default, I think the emulated middle button will be the same as the mouse wheel press, but that should be fixable by reassigning the wheel button (Evdev Wheel Emulation Button).

See also Configuring Input Devices on the Ubuntu wiki.

3
  • 1
    This answer is more correct because xorg.conf is missing on many modern systems (and has been missing for quite a while). Oct 24, 2012 at 11:48
  • I wonder whether the effect of the above command is "sticky" between sessions. At any rate, it works for me and now I can actually use The Gimp!
    – Lori
    Mar 24, 2016 at 15:29
  • 1
    @Lori It isn't sticky. Typically you'd put this in a script and add that script to your startup applications. Mar 24, 2016 at 15:38
4

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

SOLUTION:

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

a) Query your device:

xinput list

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

b) xinput list-props 10

Gives me the settings for the mouse.

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

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

d) Check if the value changed to 1:

xinput list-props 10

Yes, it works: "libinput Middle Emulation Enabled (294): 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.

What is behind it: https://wiki.ubuntu.com/X/Config/Input

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 (https://unix.stackexchange.com/users/885/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):

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

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

2

It is configured in /etc/X11/xorg.conf.

You'll see a section that looks like

Section "InputDevice"
        Identifier      "Configured Mouse"
        Driver          "mouse"
        Option          "CorePointer"
        Option          "Device"                "/dev/input/mice"
        Option          "Protocol"              "ImPS/2"
        Option          "Emulate3Buttons"       "true"
EndSection

Here is a random vaguely relevant link from SU.

https://superuser.com/questions/258649/multi-button-mouse-on-x11-how-can-i-configure-several-buttons-to-act-as-the-midd

5
  • 1
    Is there any way this can be configured without modifying xorg.conf? This is also an issue on machines where I don't have root. Mar 23, 2011 at 18:50
  • @Let_Me_Be: There might be. I'm not aware of one. Mar 23, 2011 at 18:55
  • Do you have /etc/X11/xorg.conf.d on your system? I realize this was written 6 years ago and it may not have been available then.
    – user2267
    Feb 8, 2017 at 17:07
  • no /etc/X11/xorg.conf anymore. Not even any 'InputDevice' to be found ni /etc/X11. Read more below for alternative.
    – PypeBros
    Oct 5, 2017 at 20:56
  • @PypeBros Generating /etc/X11/xorg.conf if it doesn't exist is easy enough to do. Oct 7, 2017 at 5:05
2

The third mouse button can be enabled system wide by adding a file /etc/X11/xorg.conf.d/20-3rdbutton.conf with the following content:

Section "InputClass"
   Identifier "middle button"
   MatchIsPointer "on"
   MatchDriver "libinput"
   Option "MiddleEmulation" "on"
EndSection

I use this on my HP nc2400 with Fedora 23, and it works.

The source of this information is the corrected and adapted config of comment 14 of Red Hat’s bug 1227992.

0

On a new install of Ubuntu 17.04 XFCE, this can actually be solved by removing xserver-xorg-input-synaptics:

sudo apt-get remove xserver-xorg-input-synaptics

The reason being, it seems that libinput and synaptics are competing or something.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .