4

I have a Logitech M560 mouse, but I do not know how to map the middle button to pasting, as is default in my other mouse.

I ran 'xev' and clicked the middle button in the white box. The output includes 'button 1'. So, I want to map button 1 to the 'paste selection' as clicking the right and left mouse buttons simultaneously does with my mouse now.

7
  • 1
    That should happen out of the box. What version of Ubuntu is this? What desktop environment? Does clicking left and right buttons simultaneously paste?
    – terdon
    Apr 15, 2014 at 19:12
  • Ubuntu 13.10. Oh, yes! I wasn't aware of this feature. I guess I can just get used to clicking the right and left buttons simultaneously instead of the middle mouse button!
    – Cokes
    Apr 15, 2014 at 19:17
  • That feature is how it used to work back before wheel mice were that common, when mice only had two buttons. Do you have an /etc/X11/xorg.conf file? You say that middle click pasting does work with another mouse of yours?
    – terdon
    Apr 16, 2014 at 8:18
  • I see... This xorg.conf file does not exist on my machine.
    – Cokes
    Apr 16, 2014 at 18:25
  • Yes, it doesn't by default, I was wondering if you had created one. It's a file that allows you to configure your X system (the GUI basically) and the mouse can also be configured there. Anyway, please edit your question and include xev info. You need to run xev and then middle click in the white window. Your output will include the button number, it will be something like ButtonPress event, blah blah, state 0x2010, button 2, same_screen YES we need to know which button the middle click is reported as just in case the issue is a wrong button reported.
    – terdon
    Apr 16, 2014 at 22:34

2 Answers 2

4

I had the same issue today (2016-08-29). It is unclear what caused it since I didn't upgrade anything in the past 4 days.

Rebooting didn't help.

Key observation: xev wasn't showing any event coming from the mouse when clicking the middle mouse button (scrollwheel) inside the xev little square. This indicated some low-level driver issue as opposed to an application config issue.

Mouse selection was working fine: clicking Shift+Insert or running xsel from a terminal were both pasting the current selection.

Only the pasting via the middle mouse button didn't work. The problem affected all applications, including firefox and terminals.

Eventually, this fixed it for me.

sudo dpkg-reconfigure xorg
0

this is my configuration:

~$ cat .xbindkeysrc |egrep -v "^$|^#"
"xte 'mouseclick 2'"
    m:0x50 + c:134

In this way if made "work" the middle button.

I choose the text I need to copy/paste while holding the right button, after choosing where to paste I click button. If need to paste again the same text, since the square button doesn't raise the same events every time, I'll click it quickly twice.

If you select another text the event scattered from the square button is always the one that makes xte to emulate the middle click.

Is not perfect but better than not having middle click at all.

You must log in to answer this question.

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