AutoFocus version 2.01, written by Vincent Lefvre.


No need to click on a window any more to get the focus! When the mouse
pointer enters a window, AutoFocus automatically gives it the focus if
the window has already had the focus. This module has a special support
for panes, dialogue boxes (with writable icons) and block selection.


AutoFocus is FREEWARE (it is NOT in the public domain).

Note: AutoFocus uses Andrew Clover / Andrew Booker's module WimpSWIVe to
trap Wimp_ SWIs. This module is not distributed with AutoFocus. You can
get it on:

  http://abooker.homeip.net/riscos/


WARNING! there are some incompatibilities with other software and some
applications or the whole system may crash. This is often because the
applications think the focus can only be changed with a mouse click, or
something like that. In particular, there are problems with:

_ MultiDesk 1.13: MultiDesk does not work with AutoFocus since it traps
Wimp_ SWIs with its own routine. It should be modified to use WimpSWIVe
instead.

_ Zap 1.31: you may notice some strange behaviours, but I think that's all.
For instance, after you close a Zap window, if another Zap window gets the
focus, Zap won't be aware of it (you have to click).

_ StrongEd (inc. 4.14 - 4.53): you may get "illegal window handle" errors
from StrongED (sometimes, when you click on the close icon of a StrongED
window, the upper pane disappears), and you must quit StrongED.

_ Draw 0.99: Draw may crash. For instance, type F3 over a Draw window. The
"Save as" box appears. Type return over the document window. You'll get an
"uncoverable internal error (" message, and Draw will quit.


You can make AutoFocus behave differently by changing the current mode.
The mode is a 4-bit integer (0 to 15), each bit having the following
meaning:

  * Bit 0 (value = 1 if set):
      AutoFocus is active if unset, AutoFocus is inactive if set.

  * Bit 1 (value = 2 if set):
      If set, the focus will never be removed by AutoFocus: if the
      mouse pointer goes over a window that has never had the focus,
      the window that currently has the focus will keep it.

  * Bit 2 (value = 4 if set):
      If set, the focus will not be removed by AutoFocus when the
      mouse pointer goes over a menu: the window that currently has
      the focus will keep it.

  * Bit 3 (value = 8 if set):
      If set, AutoFocus will behave in the following way: when an
      application removes the focus from one of its windows (without
      giving it, at the same time, to another window), AutoFocus will
      not give it back to this window the next time the mouse pointer
      enters the window, as if this window never had the focus before.

The default mode is 0. The mode can be set with a parameter when the
module is RMRun'ed (see the !Run file: the mode is set to 4). It can
also be changed or displayed with the *AutoFocusMode command: with no
parameters, the current mode will be displayed; with 1 parameter, the
mode will be changed. Bit 0 can be toggled with the *ToggleAutoFocus
command; this can be very useful if the command is bound to a hot key.


In any case, use AutoFocus at your own risk. If you find a bug, please
send me a bug report in French or in English to the address below.


Thanks to the comp.sys.acorn.programmer readers for their help.

Vincent Lefvre

e-mail (AutoFocus): autofocus@vinc17.org
e-mail (personal): vincent@vinc17.org
WWW (home page): http://www.vinc17.org/
WWW (Acorn / RISC OS page): http://www.vinc17.org/acorn/
