Missing copy/paste middle mouse button functionality
An unusual Ubuntu 12.04 system. It's built with minimal installation and doesn't have most of the usual Ubuntu graphical elements: no Unity, no Gnome shell, no LXDE, etc. (I use the i3 window manager). Therefore, instructions such as "Go to System > Utilities > ..." will not work on such a system.
Also, I've been using an old serial mouse on this system - the Kensington Expert mouse (trackball), and I really like it from an ergonomic standpoint. Currently I have it connected to the system via a serial to PS2 adapter and it works satisfactorily for the most part - including the key copy/paste functionality via the middle mouse button - although some oddities have come up lately . To get around these quirks, I decided to try getting a serial-to-PS2 adapter from the picture and hooking it directly to the serial port.
So I found the instructions to make a serial mouse work under Ubuntu ( https://help.ubuntu.com/community/SerialMouseHowto ), implementing those instructions and hooking the mouse to the serial port did cause most mice to work . The problem is that one of my most used and absolutely must-have features doesn't work with this scenario: I can hold down the left mouse button and drag, copy text from a graphics or terminal program, but I can't get it to work with a left mouse click key to paste it with the middle mouse button at the desired location. In short, there appears to be no middle mouse button functionality in this mode. So I'm working on ways to possibly restore the functionality of that middle button.
I should mention that, of the possible inputattach options, none are very close to my mouse. I've tried several, but some don't work and others don't. I tried --microsoft initially, but also --mshack and --mouseman. Without these, I can't get any form of middle mouse button functionality.
By the way, xev shows that when the mouse is hooked to the system via the Serial-to-PS2 adapter, I have here (starting from the bottom left and moving clockwise around the mouse) buttons 1, 2, 9 and 3 mice. I guess assigning button 9 as the middle button is a good option. or a combination of 2 and 9. However, when I remove the adapter and hook the mouse directly to the serial port, xev indicates that only 2 buttons are present: the upper left and lower right buttons are both reported as button 1, and the upper right and lower right buttons are both reported as button 1. The button is reported as button 3.
So, do I need to do some mouse button mapping? There are 4 physical buttons on this device. Maybe I need to add some supplementary xorg stanzas to the /usr/share/X11/xorg.conf.d/.conf file? Suggestions would be greatly appreciated.
I found a working answer at the stackexchange thread https://unix.stackexchange.com/questions/9973/configuring-mouse-for-rightleft-button-simulating-middle-click-for-copy-paste . It involves using the command xinput set-prop, specifically
xinput set-prop "$device_name_or_number" "Evdev Middle Button Emulation" 1
Once this was done, the middle mouse button emulation I needed was restored (pasted on pressing buttons 1 and 3 at the same time).
Afterthought: this seems to be related to evdev, and I have a /usr/share/X11/xorg.conf.d/10-evdev.conf on this system. Maybe my Option Emulate3Buttons true section should be there, not in /etc/X11/xorg.conf?
Summary: To get this solution working on my system, I edited /etc/rc.local (as the directive on the link referenced in the OP's directive) and added the following line of code:
inputattach --daemon --microsoft /dev/ttyS0
Makes the serial mouse mostly usable. Then, I added a line
xinput set-prop "$device_name_or_number" "Evdev Middle Button Emulation" 1
to my .xinitrc file (I don't use any login manager). After restarting and starting X, I can fully use (at least for my needs) the Kensington Expert Mouse. Has the middle button paste function. In addition to a better understanding of how evdev and Xorg fit together, the problem was solved.