For some time now, I wanted to use my mouse to spell out the 'Return' and
'Space' keys. I thought it handy for the following chores I do in xterm
quite frequently:
cut->paste->enter, or
cut->paste->space->cut->paste->....->enter
without moving my right hand between the keyboard and the mouse. So I bought
Logitech 4-button Mouseman and started reading manpages. I ended up adding
new <Btn4Down> translations into my .Xdefaults file (last 2 entries):
xterm*VT100.Translations: #override\n\
Prior : scroll-back(1,page)\n\
Next : scroll-forw(1,page)\n\
Shift : string(0x0020)\n\
: string(0xff0d)
Now, when I paste a command into the paste buffer, I can execute it by just
hitting middle button followed by Button4, or add a space behind it by
Shift+Button4 and paste some more stuff behind it.
BTW, don't forget to add 4 button mouse to /etc/X11/XF86Config:
Section "Pointer"
Protocol "MouseManPlusPS/2"
Device "/dev/mouse"
Resolution 100
Buttons 4
EndSection
Related useful resources: xev, xmodmap, xterm and their respective man pages.
I believe this will also work with them trackballs, other 4 button creatures
and possibly with them scrolling rodents, too.