@database "MyMouse Instructions"
@author "Andrew Forrest"
@(C) "Public Domain"
@wordwrap
@$VER: MyMouse.guide 1.2 (08.01.94)

@node Main "MyMouse--A Lovely Program"
		@{b}@{fg highlight}M Y M O U S E@{fg text}@{ub}

by Andrew Forrest (based on @{i}QMouse@{ui} by Dan Babock)

	@{"I want to know more" link Introduction}
	@{"Tell me how to use it" link Instructions}
	@{"Give me some examples" link Examples}

	@{"Technical stuff" link Details}
	@{"Version history" link History}

This is version 1.2 of MyMouse, by Andrew Forrest. It is completely in the Public Domain and no liability for this program will be accepted by the author--you use it entirely at your own risk.

I can be contacted electronically as "aforrest\@cs.strath.ac.uk"--bug reports, suggestions and comments are welcomed.

Share and enjoy.
@endnode


@node Introduction "Some Brief Words of Introduction"
MyMouse is a utility program which does several different things. Each of these things can be switched on or off or have the parameters adjusted.

* Nominally MyMouse is a "mouse-accelerator"--when you move the mouse quickly, it makes the mouse pointer move faster.

* It can make the mouse pointer disappear if the mouse does not move for more than a certain time or if the user presses a key

* It can blank the screen after a certain period of inactivity. (To prevent the screen image being "burnt-in" to the monitor.)

* It can bring windows to the front when you click on them or when you click on the window border.

* It can "send windows to the back" when you click on them with both mouse buttons.

* It can activate windows when the mouse is over them.

* It can activate the most recently used window of the frontmost screen whenever the screens are rearranged (with Release 3 only).

* It can perform any CLI command when <Left-Amiga><Esc> is pressed.

* It can stop any program from flashing the screen (DisplayBeep).

* It can map some keys from a Northgate Omni keyboard to normal Amiga keys.

* It is totally Public Domain--distribute it in any way you like.

* It will only work with Release 2 (and higher) Amigas. (If you have Workbench 1.3 or 1.2, you can stop reading now.)

Once upon a time there was a Public-Domain mouse-accelerator / window-to-front / sunmouse / screen-blanker program called QMouse. It was written by Dan Babcock. After using this for a while I discovered that it did not blank he screen when AMOS was running (well, it blanked it, but it did not @{i}unblank@{ui} it again afterwards). Also, I had come to like the click-to-front mechanism in OpenWindows (a window system under the Unix Operating System). So I decided to modify QMouse. Then I realised that I could improve the way that QMouse worked internally. The result of all this hacking about with QMouse was "MyMouse". It still contains some of the code (and ideas) from QMouse but has some features removed, some added and the code tidied up. I hope you like it.
@endnode


@node Instructions "How to Use It"
MyMouse must be run from the CLI or shell and can be followed by any or all of its parameters. Typing "MyMouse ?" will supply a list of the possible parameters. They are listed below in detail.

You can change MyMouse's settings after you have run it, by running the program again. If you omit a command-line option, that option will be `switched off'. Running "MyMouse" with @{i}no@{ui} parameters switches off all of MyMouse's options and also removes its input handler, possibly speeding up your machine slightly.

(There is no need to type "run mymouse" since the program automatically detatches itself from the CLI.)

Here is the list of parameters:

	@{"M=MBLANK/K/N" link "MBLANK"}
	@{"S=SBLANK/K/N" link "SBLANK"}
	@{"A=ACCELERATION/K/N" link "ACCELERATION"}
	@{"T=THRESHOLD/K/N" link "THRESHOLD"}
	@{"CTF=CLICKTOFRONT/K/N" link "CLICKTOFRONT"}
	@{"CTFB=CLICKTOFRONTBORDER/K/N" link "CLICKTOFRONTBORDER"}
	@{"CTB=CLICKTOBACK/S" link "CLICKTOBACK"}
	@{"ASW=ACTIVATEFRONTSCREEN/S" link "ACTIVATEFRONTSCREEN"}
	@{"CMD=COMMAND/K" link "COMMAND"}
	@{"SUNMOUSE/S" link "SUNMOUSE"}
	@{"NORTHGATE/S" link "NORTHGATE"}
	@{"NOBEEP/S" link "NOBEEP"}

MyMouse will crash if you give it a Workbench tool icon, since it is designed to run only from the CLI. However, it will cope well with pretty much anything else you throw at it. Specifically, you can make MyMouse `resident', or even run more than one copy of the program simultaneously (not that I can imagine why you would want to do that).
@endnode


@node MBLANK
@{b}M=MBLANK/K/N@{ub}

Use this parameter to specify that the mouse pointer is to be blanked and to specify the number of seconds of (mouse) inactivity after which it should be made invisible. For example "MyMouse MBLANK 20" would blank the mouse pointer if it does not move for 20 seconds (and would also blank it if the user pressed a key). If the pointer should @{i}only@{ui} blank when the user presses a key, specify a `time' of 0, e.g. "MyMouse M=0".
@endnode


@node SBLANK
@{b}S=SBLANK/K/N@{ub}

If "S" or "SBLANK" appears in the parameter list, followed by a number, MyMouse will blank the screen after that number of seconds of inactivity. This feature is to prevent so-called "monitor burn-in" whereby if a still image remains for too long on a monitor (or television) screen, the image can be burnt in to the screen permenantly.
@endnode


@node ACCELERATION
@{b}A=ACCELERATION/K/N@{ub}

This option sets and switches on the MyMouse acceleration feature. It requires a number which is the acceleration to be used. An acceleration of 1 or 2 is probably about as fast as you will ever need. Note that more recent versions of the Amiga Operating System have mouse acceleration built-in, so this option may well remain unused (see your "Input Preferences" tool for details).
@endnode


@node THRESHOLD
@{b}T=THRESHOLD/K/N@{ub}

This option has no meaning except when used in conjunction with the @{"acceleration" link ACCELERATION} option. It specifies the number of screen pixels which the mouse has to move before acceleration is applied. The idea is that when you move the mouse slowly, you want exact control, and so acceleration is undesirable, but when you move the mouse fast, acceleration is good. Example: "MyMouse A=2 THRESHOLD=4" would apply a 2-times acceleration of the mouse whenever it moved more than 4 pixels at a time.
@endnode


@node CLICKTOFRONT
@{b}CTF=CLICKTOFRONT/K/N@{ub}

This option should be followed by a number and specifies how many clicks of the mouse should bring a window to the front of the other windows. So if you specify CTF=1, a single click on a window will bring it to the front, whereas CTF=3 will require a triple-click to bring a window to the front.
@endnode


@node CLICKTOFRONTBORDER
@{b}CTFB=CLICKTOFRONTBORDER/K/N@{ub}

Use this in conjunction with the @{"click-to-front" link CLICKTOFRONT} option--it specifies that only a click on a window's border should bring it to the front; clicking on any @{i}other@{ui} part of the window should have no effect. This option is followed by a number which specifies the borders which should allow clicking-to-the-front:

	1 - Top border (i.e. the title bar of the window)
	2 - Bottom border (the lower edge of the window)
	4 - Left border
	8 - Right border (often contains a scroll bar)

Add up the numbers of the borders upon which a click should bring the window to the front.

For example, if you wanted only a click on the left or the right borders to bring a window to the front, specify "CLICKTOFRONTBORDER=12" (4 + 8 = 12). Remember that for this option to work, the click-to-front option must also be used--if you wanted a double-click on a window's title bar to bring a window to the front, this would do the trick: "MyMouse CTF=2 CTFB=1".

To allow a click on @{i}any@{ui} part of the window to bring it to the front, leave out the CTFB option. To allow any @{i}border@{ui}, specify "CTFB=15" (1 + 2 + 4 + 8 = 15).
@endnode


@node CLICKTOBACK
@{b}CTB=CLICKTOBACK/S@{ub}

This option allows you to send any window to the @{i}back@{ui} of other windows by clicking on it with both (left @{i}and@{ui} right) mouse buttons, for example "MyMouse CTB". This option has something of a disadvantage in that the Workbench uses the right mouse button to cancel some left-button operations--CLICKTOBACK interferes with this.

Also, the original QMouse allowed you to send @{i}screens@{ui} to the back by clicking on anything that wasn't a window with the left and right buttons--this program doesn't. (I didn't like that feature.)
@endnode


@node COMMAND
@{b}CMD=COMMAND/K@{ub}

This parameter specifies the command to be executed when you press the two keys <Left-Amiga> and <Esc>. This is most often used to provide a "pop-CLI" feature--`MyMouse CMD "NewCLI"' would pop up a new CLI window, for example, whenever <Left-Amiga><Esc> is pressed.
@endnode


@node ACTIVATEFRONTSCREEN
@{b}AFS=ACTIVATEFRONTSCREEN/S@{ub}

If you specify this option, MyMouse keeps a record of which window is `active' on each screen. Whenever a screen comes to the front of the display, its `active' window will be activated. Basically this means that if you have multiple screens and are moving between them, you don't need to keep clicking on windows to activate them, since MyMouse @{i}remembers@{ui} which window you were using and activates it for you.               

This option only works with Release 3 of the Operating System (V39).
@endnode


@node SUNMOUSE
@{b}SUNMOUSE/S@{ub}

Named after the Sun workstation (I think), this option activates whatever window the mouse pointer is over. You may find this useful, but it can often be more inconvenient than useful.
@endnode


@node NORTHGATE
@{b}NORTHGATE/S@{ub}

If you've got a Northgate Omni keyboard, this option translates the <page-up>, <page-down>, <begin> and <end> keys to regular Amiga key sequences (<Shift><Up-Arrow>, <Shift><Down-Arrow>, <Shift><Left-Arrow> and <Shift><Right-Arrow> respectively).
@endnode


@node NOBEEP
@{b}NOBEEP/S@{ub}

Some programs apparently overuse the Intuition screen-beep feature, flashing the screen at every available opportunity. This option turns off Intiution's DisplayBeep function.
@endnode


@node Examples "For Example"
@{b}MyMouse activatefrontscreen mblank 0 a=1 ctf 2 sunmouse@{ub}

This would switch on the @{"activate-a-window-of-the-frontmost-screen" link ACTIVATEFRONTSCREEN} feature, @{"blank the mouse" link MBLANK}  whenever a key is pressed, switch on @{"mouse acceleration" link ACCELERATION}, bring a @{"window to the front" link CLICKTOFRONT} when you double-click on it and @{"activate the window" link SUNMOUSE} under the mouse pointer.

@{b}MYMOUSE s 120 MBLANK=10 threshold 8 ctf 1 ctb ctfb 1@{ub}

Note that case is not significant with this program (or many other CLI commands). This command would @{"blank the screen" link SBLANK} if nothing happens for two minutes (120 seconds), @{"blank the mouse" link MBLANK} after 10 seconds, bring any @{"window to the front" link CLICKTOFRONT} when you click on its @{"title bar" link CLICKTOFRONTBORDER} and send @{"windows to the back" link CLICKTOBACK} when you press both mouse buttons. Note that the @{"threshold" link THRESHOLD} option has no effect since @{"acceleration" link ACCELERATION} was not selected.
@endnode


@node Details "Technical Details"
MyMouse was assembled with Devpac 3 and my own set of include files. Specifically, "include everything.i" includes all of the Release 3 include files as well as macro definitions for "push" ("move.\0 \1,-(sp)"), "pop" ("move.\0 (sp)+,\1"), "pushm", "popm" (similar, but use "movem") and "just" ("jsr _LVO\1(a6)").

With the original QMouse it was a rather dodgy matter to change the settings after you had run it, since each time you ran the program, the previous invocation of the program would attempt to deallocate itself and quit, rather a tricky thing to do.

The MyMouse process (called "Funky baby Mouse process") stays permenantly in memory once it has been installed (until you reboot the machine). Running MyMouse again simply changes the parameters of the @{i}existing@{ui} process. The reason it never exits is that it is almost impossible to cleanly deinstall a "patch" on the operating system, the method that MyMouse uses to suppress the Intuition DisplayBeep. So it is not possible to recover the memory or resources that MyMouse uses without rebooting the machine. (Don't worry; it is not heavy on memory or other resource use.)

I should also note that MyMouse patches only three OS routines (DisplayBeep, ScreenDepth (V39) and CloseScreen (V39)) and so should work happily with many future versions of the Amiga Operating System. (That is to say, it manages to blank the mouse in an even @{i}more@{ui} OS-friendly way than QMouse:) Having said that, I have not tested the program with ReqTools, which is apparently rather tricky with its mouse pointer...)

The other two patches on the Operating System are to arrange the ActivateFrontScreen option. This makes use of a new funtion in V39 Intuition, "ScreenDepth()", through which all screen arranging is funnelled. The table of screens and their corresponding active windows is arranged as a linked list, each node of which holds several entries, which makes efficient use of memory without sacrificing flexibility (in the number of screen-window pairs which can be held). With a reasonable number of screens--less than 8--only one list node is ever needed.

If you use AMOS, there is another reason to use MyMouse--it properly blanks and unblanks the screen when AMOS is active. (For this, I needed to hike up the priority of the input handler to a whopping 100.) On the down side, the screen blanker works like QMouse's, by switching off screen DMA--this will almost certainly not work on future Amigas with retargetable graphics.
@endnode


@node History "Program version history"
@{b}1.0@{ub}
The very first release.

@{b}1.1@{ub}
Fixed a bug which sometimes blanked the mouse forever. Also, mouse blanking and unblanking has now been offloaded onto the main process, rather than being arranged by the input handler. Mouse and screen are now automatically unblanked if mouse/screen blanking is switched off.

@{b}1.2@{ub}
Added ActivateFrontScreen option which is something that QMouse had originally but which I removed because it was implemented badly. In addition, options to switch on AmigaDos asterisk-as-wildcard option and declick disk drives have been offloaded to another program: "Knobs".
@endnode

