This file describes a few aspects of the SKY MOUSE PACKAGE (short for
SAVE/KILL/YANK). It is an extract of our public domain package which is
organized a little differently.

Cf. the end of the file etc/.emacs for a quick overview of the mouse functions
available under Emacs x-mouse and Epoch.

To let Emacs lisp see inside window mouse events and consistently
interpret cut and past clicks you may have to find the right setting
for your .Xdefaults file and/or your .twmrc or other window manager definition.
In order to ease this effort, there is a sample setup .Xdefaults
and also the following paragraphs explain a little of this issue.


1. Window manager and mouse buttons 

If you are running twm and your .twmrc tells twm to filter button events
that go to the WINDOW, we recommend to remove the corresponding lines.

The mouse package expects to receive all button events! Some default settings
for window managers, such as twm, filter all Meta events (a button event in
which the meta modifier key is pressed simultaneously). This stems from times
in which applications under X did not exploit the full mouse functionality.
Usually such codings are no longer necessary to get fast at window manager
functions such as move or resize window. Most window managers support title
bars or other decorations that allow you to get at the corresponding functions
from a small icon. Moreover many of the functions can be placed on function
keys (like the left function key block on Suns). Therefore we recommend not to
reserve modifiers in combination with mouse buttons for purposes of the window
manager.

If, however, you are used to the way you access your window manager through
reserved mouse events, and you do not want to change this habit, look through
the end of the file epoch-mouse-base.el or x-mouse-base.el (if you are using
the mouse package under Emacs x-mouse). There you will find the allocations of
mouse commands to buttons. Since some of the commands belong to command groups
that are used together, you may wish to consider that it is ergonomically
better to put them on mouse buttons with the SAME MODIFIER OR at least to make
sure that from one function to the next related one the user should AT MOST
CHANGE either ONE mouse button or the state of one modifier. This not only
simplifies recall but also the trail of invoking mouse actions.

If you want to 'freedom for the mice' just remove the .twmrc (or what have you?)
lines that specify buttons on the WINDOW. The window manager can still exploit
all button events that address the frame (outside window decoration).

This is an alternative that makes a few function keys work like under olwm.
  "L5"    =               : window|icon   : f.raise
  "L7"    =               : window        : f.iconify
  "L7"    =               : icon          : f.deiconify
Cf. also the keboard button inscriptions on a SUN keyboard. At least SUN
window mgrs seem to use this kind of function allocation consistently.

If you do not like to catch unmodified function keys before they are seen
by an application, here is a way to qualify them with the alternate modifier
that seems to be unused by most graphic applications we know of.
In a shell or your X startup customization, you may add

    > xmodmap -e 'clear mod2' -e 'add mod2 = Alt_L' -e 'add mod2 = Alt_R'

In  .wmrc you may add

    "L5"    =  m2             : window|icon   : f.raise
    "L7"    =  m2             : window        : f.iconify
    "L7"    =  m2             : icon          : f.deiconify


2. X resource definitions

2.1 Changing from Emacs to Epoch

If you have not used Epoch before but you are used to Emacs, you may
want to transfer to Epoch some of the X resource settings that you
have worked out for Emacs. The following lines taken from my setting
may help to do that.

----------
! Use lower case 'epoch' otherwise this will be without effect at least here
! (sun4, sparc, SunOS Release 4.1, X11R4, olwm, Epoch 3.2.2)
! if this does not work try use Emacs resources instead.
!Emacs*minibuf.font:	-*-courier-bold-r-*-*-20-*-*-*-*-*-*-*
!Emacs*minibuf.geometry: "80x2+0-0"
epoch.minibuf.resource: epochMinibuf
epoch*font:	        SMALL_TEXT_FONT
epoch*boldFont:		SMALL_BOLD_TEXT_FONT
epoch*minibuf.geometry: 120x1-40-27
epoch*screen.geometry:  100x59-65+55
epoch*cursor-glyph:     2
!does not work:
!OpenWindows*Epoch*EpochMinibuf*ClientDecoration: -border

#ifdef COLOR
#else
!Emacs*ReverseVideo:	on
!Emacs*BorderColor:	white
!Emacs*BorderWidth:	2
!epoch*screen.reverse:	on
epoch*minibuf.reverse:	on
epoch*minibuf.BorderColor:	white
epoch*minibuf.BorderWidth:	2
#endif
----------

2.2 Cut and paste between Epoch and other applications

In the resource setting you may also specify how button events are interpreted.
A number of applications like xterm respect such settings.

Actually the standards used by different window managers are conflicting. For
instance, under most X11R4 tools it is a common default to have Middle mean
paste and right mean extend selection.  In contrast to this, the Openlook
standard requires that Middle means extend/adjust.

The mouse package tries to adapt to your standard, but it is not very
intelligent in this respect. There is an environment varialbe WINMGR that it
look at. When the value of this variable is olwm, then the package thinks you
are running the olwm window manager and you are used to extending selection by
using the Middle button of the mouse.  The mouse package will allocate the
mouse functions accordingly. If the value of WINMGR is anything else (including
undefined), the package assumes that Right is the extend button of your choice.
In other words you may set the WINMGR variable in your .login or .cshrc or what
you to tell the mouse package your preferences.

In this context it may be useful to recall that you also can use the X
resources to make the behavior of different applications consistent with
respect to the mouse. Here again an extract of the settings that may help you
to explore this possibility further.

This setting overwrites the middle button default actions to paste Epoch
(3.2.2)'s cut buffer and use the primary selection only with shift.  Thanks to
beldar@mips.com (Gardner Cohen) and other netters on epoch@cs.uiuc.edu.

---------
XTerm*VT100.Translations: #override \
	~Meta ~Shift <Btn2Up>: insert-selection(CUT_BUFFER0)\n\
	~Meta Shift <Btn2Up>: insert-selection(PRIMARY)
---------

The following setting is a modified default version (cf. man xterm) that may be
useful with the WINMGR=olwm mouse command installation of the mouse package.
middle extends, right pastes, shift right let's you get at the primary
selection even if you got a different cut buffer from another application.

---------
XTerm*VT100.Translations: #override \
	 Ctrl ~Meta<Btn1Down>: popup-menu(mainMenu) \n\
        Ctrl ~Meta <Btn2Down>: popup-menu(vtMenu) \n\
	Ctrl ~Meta <Btn3Down>: popup-menu(fontMenu) \n\
             ~Meta <Btn1Down>: select-start() \n\
           ~Meta <Btn1Motion>: select-extend() \n\
       ~Ctrl ~Meta <Btn2Down>: start-extend() \n\
           ~Meta <Btn2Motion>: select-extend() \n\
       ~Ctrl ~Meta <Btn3Down>: ignore() \n\
	~Meta ~Shift <Btn3Up>: insert-selection(CUT_BUFFER0)\n\
  	 ~Meta Shift <Btn3Up>: insert-selection(PRIMARY)\n\
          ~Ctrl ~Meta <BtnUp>: select-end(PRIMARY, CUT_BUFFER0) \n\
                    <BtnDown>: bell(0)
---------




	 


	ENJOY!
