Make that 4th mouse button do something useful

Extracted from Web submission (man xterm)
Tip provided by Jiri
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.

Follow-up :
| Previous | Next | Index of category | Main Index | Submit |


Appears in section(s) : X configuration
Tip recorded : 16-05-1999 20:44:14
HTML page last changed : 27-07-1999 20:05:55