************************************************************************** - THE LEGENDARY >> SUBSOFTWARE << IN 90 !!! =========================================== - CONTACT US - BP: 36 - - 1380 REBECK - - BELGIUM - - DON'T SEND ANY DISKS - ************************************************************************** V1.20 DMOUSE.DOC 3 August 1989 Matthew Dillon 891 Regal Rd Berkeley, California 94708 USA DMouse (c)Copyright 1989 by Matthew Dillon, All Rights Reserved Refer to BLANKER.DOC and DMOUSE-IPC.DOC for information on external screen blankers. NOTES: * dres.library no longer required. * IPC mechanism changed WORKBENCH USERS: PLEASE READ THE REVISION HISTORY FOR V1.09 FOR PARTIAL SOLUTION TO INTUITION WINDOWTOFRONT() BUG. YAIH (Yet Another Input Handler)... nahh, like DMouse better... for "Dillon's Mouse"??? V1.20 and beyond are no longer in public domain, but copyright to me. They are still 'freeware'. After looking at and rejecting several mouse-intuition input handler enhancers (you know, accelerate the mouse, click-to-front, etc...) and finding them all useless, I have written my own. - Any option can be turned on or off at any time. - Screen blanks if keyboard or mouse is idle > N1 secs (default 300) (mouse also blanks even if mouse blanking not turned on) One can install a more sophisticated screen blanker (e.g. one that brings up a pattern or something) if they wish. - The Pesky Mouse blanks if mouse is idle > N2 secs (def 5) - Auto Activate a window when the mouse is moved over it. Window also activated (if not already active) when you type. These two features may be turned on/off independantly - Mouse Accelerator. Back feeds power into the mouse unit; give it a nudge and it is guarenteed to penetrate up to an inch and a half of wall plaster (programmable depth). Once you start using it, you won't be able to switch back! - Programmable command-key and command string ala PopCli, default left-Amiga ESC. - Left Mouse Button click in window brings it to the front DOES NOT BRING THE WINDOW TO THE FRONT IF IT IS ALREADY IN THE FRONT. Other programs would call WindowToFront() on every click, which is horrible if you have a simple-refresh window. WindowToFront() is NOT called for backdrop windows! The qualifier along with the LMB is now settable with the -l option. # clicks required is settable. - Hold LMB, click Right Mouse Button .. Window to Back! Great for cycling windows. See next feature for more info. (the qualifier, normally the left mouse button, can be set with the -R option). - Same sequence as above, but if there is no window under the current mouse position, there is only one window on the screen, or the window under the mouse is a BACKDROP window, the sequence cycles through Screens! - NO DAMN CLOCK. Use another utility to get a clock. No other glossy thrills. DMouse is short, sweet, and functional. - Does not use a CLI, should be placed in your startup-sequence. DO NOT 'RUN' DMOUSE! INSTALLATION: Place dmouse-handler in L: (or in the 'current' directory when DMOUSE is run). WORKBENCH USERS!!!!!!!!!! There appears to be a bug in intuition's WindowToFront() call, which can lock up intuition when workbench icons are active. Under the defaults, this will occur whenever you depress the left mouse button over an icon. A partial fix is in place V1.07 and beyond. However, if you find it still freezing up, the problem can be avoided as follows: Either turn off the left-mouse-button window- to-front feature (-L0) or leave it on and set the number of clicks required to 2 (-c2) (and don't use the feature while your mouse is over an icon). V1.09 gives you yet a THIRD option which is even more preferable ... change the qualifier that goes along with the left mouse button to something other than 0, like 3 (either shift). -l3 BLANKER: To use a third party blanker (currently only the example at this time) just run it in the background after you run dmouse. EXECUTE FROM A CLI (e.g. WORKBENCH STARTUP SCRIPT), example: 1> dmouse -c2 -l0 -C c:newshell "nil: newcon:320/120/320/80/Shell" There is no need to 'RUN' DMouse. A double set of quotes may be required for the program to work properly with ConMan. NOTE: The shell startup script should immediately CD somewhere. DMouse does not remember the cli's path. TO KILL: 1> dmouse QUIT IPC SUPPORT: IPC support has changed radically due to removal of dres.library from the required list. The reason for the change is that I have been getting my programs to compile under both Lattice and Aztec and did not want to port dres.library to Lattice C. Please refer to the example blanker programs and dmouse-ipc.doc for more information. SOURCE: Source is compileable under Aztec, +L (32 bit ints) and suitable precompiled include file (remember the precompiled include file must be precompiled with +L also). Use the c32.lib library (Aztec C) Source is also compileable under Lattice C V5.02 and beyond. You need a working sup32.lib library to compile DMouse. The library source also includes the local/*.h includes and DMakefiles for making precompiled include files. COMMAND LINE ARGUMENTS: If DMouse is already running, any specified options will be incorporated. quit QUIT .. remove DMouse -h HELP -a# Set acceleration to #. Default 3, 1 disables option -t# Set mouse acceleration threshhold, pixs/ev. default 0. -s# Set screen timeout to # (secs), Default 300, 0 disables option -m# Set mouse timeout to # (secs), Defalut 5, 0 disabled option -c# Set # of clicks required to bring window to front (def 1) -p# Set input handler priority (def 51) should always be > 50 (initial invocation only) -w# 0 = use UpFrontLayer() etc... 1 = use WindowToFront() etc... WindowToFront() properly refreshes SIMPLE_REFRESH windows but a bug intuition can cause it to crash the machine if a workbench icon is active at the time. -L0/1 Disable/Enable left-button brings window to front -A0-3 Disable/Enable AUTO-ACTIVATE. Bit #0 = mouse auto-activate #1 = keyboard auto-activate (default 3, which enables both) -lqqqq Set Qualifier (HEX) with LMB for Window To Front (default is 0, meaning no qualifier). Example: -l0003 sets it to either shift key. -Rqqqq Set Qualifier (HEX) with RMB for Window To Back (default is the LMB qualifier). Setting the qualifier to 0 disables the feature. -Kcccc Set Keycode (HEX) for command key (default 0045) -Qqqqq Set Qualifier (HEX) for command key (default 0040) -C CMD Set Command to run. Default is NEWCLI. Remaining arguments on command line is the command. -S/-M REMOVED. Obsoleted by new IPC mechanism. QUALIFIERS (always entered in HEX) 0001 Left Shift 0002 Right Shift 0004 Caps Lock 0008 Control 0010 Left Alt 0020 Right Alt 0040 Left Amiga Key 0080 Right Amiga Key 0100 Numeric Key Pad Key (not useful for dmouse) 0200 Repeat (not useful for dmouse) 0400 Interrupt (not useful for dmouse) 0800 Multibroadcast (not useful for dmouse) 1000 Middle Mouse Button (not normally implemented by intuition) 2000 Right Mouse Button 4000 Left Mouse Button Note: Combinations are allowed, in which case any one of the selected qualifiers along with the left, right mouse button or command key will cause the appropriate action to occur. RELEASE HISTORY: V1.20 -3rd party IPC mechanism fixed. A new mechanism is now in place. V1.16 -Code fixed to compile under either Manx C 3.6 or Lattice C 5.02 -3rd party screen blanker supported removed due to removal of dnet.library (which is too difficult to port at this time). V1.14 -minor bug fixes. DLineArt added to distribution (removed again in 1.16 temporarily) V1.13 -d option (debug mode if compiled in) not compiled in on release binaries -You can now bring up a new cli without having to move the mouse from its initial (power up) position. -Checks if the copper list stuff it modifies is valid. If not, does not modify the copper list stuff (you loose mouse blanking instead of crashing the machine for those using the hires board) V1.12 -S option added, external screen blanker supported. -M option added, external mouse blanker supported. -IPC commands changed to 'mouse on/off' 'screen on/off', they used to be 'mouse / nomouse' and 'blank / noblank'. V1.11 -Intelligent requester handling: auto-activate is disabled while the active window has a requester in it. Slight modification of key handling (key-up events are ignored by DMouse). Addition of text-based IPC to blank/unblank the mouse/screen. V1.10 -Fixed -A bug ... -A2 now enables auto-activate-on-key and disables auto-activate-on-mouse V1.09 Workbench users probably want to use the following options: -w1 -l0003 These use WindowToFront() (your windows get refreshed properly), but also requires you to depress a shift key + LMB to get the window-to-front feature. dmouse -w1 -l0003 -SELECTABLE USE OF UpFrontLayer() etc.. OR WindowToFront() etc... Workbench users should use WindowToFront() (-w1), while CLI users probably want to use UpFrontLayer() (default). Reason: WindowToFront()/Back can crash the Amiga if called while a workbench ICON is highlighted. Unfortunetly, UpFrontLayer(), which does not have the bug, also does not automatically refresh simple-refresh windows! -New option -lqqqq (SET QUALIFIER WITH LEFT MOUSE BUTTON TO GET WINDOW-TO-FRONT FEATURE). WORKBENCH USERS NOTE: By setting this qualifier to a shift key, for instance, you can safely move icons around without crashing the machine because DMouse will not issue the WindowToFront() call unless you are holding the qualifier key down while pressing the left mouse button. -Bug fixed thanks to user persistance! If you disable mouse blanking, and enable screen blanking (which blanks the mouse too when it happens), hitting a key would bring back the screen but not the mouse. V1.08 Botched. V1.07 -All intuition calls are made from an independant process rather than the input handler routine. This also fixes a couple of deadlock bugs, but not the workbench-icon deadlock bug. -Mouse response is no longer jerky when the system is loaded down. -Keyboard-Auto-Activate-Window independant of Mouse-Auto-Activate-Window (enhanced -A option) -No need to OR the -Q qualifier with 8000 anymore -WindowToFront() never called for backdrop windows, which ought to fix the workbench freeze bug and other problems. -Mouse automatically blanked when screen blanks, whether mouse blanking is enabled or not. -Can set input handler priority (initial invocation only). -New Timeouts go into effect immediately rather than after the next mouse/keyboard event. V1.00-V1.06 Before Written history ============================================================================ Talking to DMouse. DMouse listens on the "DMouse.ipc" port. To send a message, setup an IORequest structure with the appropriate command and then FindPort()/PutMsg() atomically, then wait for the request to be returned to the reply port specified in the request. *** REFER TO THE EXAMPLE BLANKER.C FOR USAGE DMCMD_MOUSEON turn on mouse (io_Command 0x80) DMCMD_MOUSEOFF turn off mouse 0x81 DMCMD_SCREENON turn on screen 0x82 DMCMD_SCREENOFF turn off screen 0x83 DMCMD_ADDHANDLER io_Message.mn_ReplyPort 0x84 contains port to send msgs to. DNCMD_REMHANDLER io_Message.mn_ReplyPort 0x85 contains port to stop sending msgs to. DNCMD_PLEASEREMOVE (DMouse->blanker) 0x86 DNCMD_ADDHANDLER: io_Unit contains a magic cookie used to identify the handler and should be set to some unique memory address (no accesses are actually made, its just an identifier. io_Flags contains a bitmap of things our blanker can handle: 0x03 we can handle mouse blanking 0x0C we can handle screen blanking 0x0F we can handle both The request is NOT returned until you send a DNCMD_REMHANDLER request. If DMouse is killed it will sent a DNCMD_PLEASEREMOVE (0x86) packet to all active handlers and expect them to remove their handlers with a DNCMD_REMHANDLER request. NOTE: You may run multiple blankers. DMouse will send requests to ALL active handlers. DNCMD_REMHANDLER: io_Unit contains a magic cookie that identifies which handler to remove. The request is returned and then the original DNCMD_ADDHANDLER request will be returned to you. You can still receive DMouse commands up until you finally get the original DNCMD_ADDHANDLER request back. on return, io_Error is 0 on success, -1 on failure. DNCMD_PLEASEREMOVE: DMouse sends this to you asking you to remove your handler. If you receive this packet you must remove your handler with DNCMD_REMHANDLER. DNCMD_MOUSEON,MOUSEOFF,SCREENON, SCREENOFF and PLEASEREMOVE commands will be sent to the port specified in DNCMD_ADDHANDLER while it is active and are expected to be returned to the DMouse handler. You can differentiate packets sourced by DMouse and packets sourced by you by looking at the mn_Node.ln_Type field. If it is NT_MESSAGE it was sourced by DMouse, else it was sourced by you and replied by DMouse.