Here’s a trick. Many laptop trackpads lack a middle mouse button. On a regular mouse input device, the middle mouse button is the scroll wheel, and when you press it down it emits a button event. In X11 this button event is used to paste the X selection buffer into the position right beneath the cursor (there lies sublime usability in this simple fact).
You can emulate a middle-mouse-button event by pressing the left and right mouse buttons at the same time. Since I lack the manual dexterity to do this on my tiny netbook trackpad I wanted to be able to do middle-mouse-button-paste with my keyboard. Well, that appeared to be easy to accomplish with the X11 Xtest extension for which the Xautomation collection includes a utility in the form of xte. If you’d enter xte 'mouseclick 2' in a terminal (within an X11 session, of course), you’d get the same effect as if you’d just pressed the middle mouse button. Only thing left is to add a keyboard shortcut to run this command; in my favourite window manager, XFCE, this can be done clickwise via the Settings Manager or simply by running something like xfconf-query -c xfce4-keyboard-shortcuts -p '/commands/custom/<Super>v' -s "xte 'mouseclick 2'". I can now paste my X selection buffer by pressing the funny ‘four-wobbly-squares key’ and ‘v’ simultaneously.
Tags: clipboard, en_GB, X11 —


hi,
I’m trying to do the same. I installed superswitcher, which works by pressing the Super key, but I want to map the +o combination to the following
xte ‘keydown Super_L’ ‘key Up’ ‘keyup Super_L’
But somehow this doesn’t work. If I run it in the terminal it works OK, but it doesn’t work when invoked through XFCE shortcut. Do you know what may be the problem?
Thanks much
Wicher Reply:
April 20th, 2010 at 14:38
Superswitcher looks interesting.
Using hotkey combinations can be a bit of a mess when several programs claim combos. It might work if you first start superswitcher and then re-add your key combo in the xfce keyboard shortcut settings, but you don’t want to do that every time you start xfce.
Most of what Superswitcher can do can already be done by xfce (look into the ‘window manager -> keyboard’ settings), so maybe you should file a feature request on the xfce site, asking to add some of the features you now use superswitcher for?