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 Is your computer BORED? If so, then you need... DLineArt, by Steve -Raz- Berry with help from Matt Dillon. IF YOU ARE IMPATIENT WITH LONG WINDED README'S... skip to the section labeled Examples and try them out... This program must be used in conjunction with Dmouse 1.13, and is intended to be a screen blanker replacement program. IT IS NOT STAND ALONE. An earlier release of LineArt works without Dmouse. 0) SHORT HISTORY ---------------- This display hack does nothing usefull, but draw pretty lines on a custom screen. I have seen this program running on everything from Suns to Mac's, and I decided that it was time that one was done for the Amiga. Although similar to the lines demo distributed on Workbench 1.1 & 1.2, It does things on it's own screen in full 4096 color interlaced splendor :*). Matt Dillon liked it so much that he stitched in a way to add your own customized screen blanker via an IPC port. As soon as I found Dmouse 1.13, I took his example "blanker.c", and hacked it up to support LineArt graphics. I also fixed a few bugs and added a few more things along the way. When I first wrote this program, I was unaware of MACKIE written by Tom Rokicki, which draws the same kind of lines boxes and splines as part of a hot-key/screen-blanker type program. Undaunted (although somewhat embarassed) I proceeded to allow infinite customization to those who are bored enough to want to play with LineArt. Besides, I prefer DMOUSE (Thanks Matt!) for my hot-key handler. Don't get me wrong, I really like the way Tom does splines... In fact I stole his spline code and put it in (D)LineArt. 1) TO GET DMOUSE TO RECOGNIZE DLineArt - -------------------------------------- To make dmouse (v1.20+) use the DLineArt screen blanker instead of its default blanker (a boring blank screen) simply run DLineArt after you initialize dmouse. ------------------------------------------------------ stack 4000 dmouse -a4 -m3 -s90 -l0003 -w1 -t7 -C NewWSH runback -1 DLineArt -a -n 3 -c2500 -l30 ------------------------------------------------------ To terminate DLineArt do this: raz's prompt> status Process 1: Loaded as command: dlineart Process 3: Loaded as command: status raz's prompt> break 1 The break command will terminate DLineArt. Terminating DMouse (1> dmouse quit) will also terminate DLineArt. 2) INVOCATION: ------------- There are a LOT of comand line options (for a program like this anyway)! You need to run DLineArt in the background for it to function properly. You can enter the options in ANY order on the command line, and only the last occurance of a particular switch will be used. The options are: run >nil: nil: DLineArt 3 -a -c1280 -l10 -TBOING! 3) EXAMPLES: ----------- Some of my favorites: runback DLineArt 4 -l100 -c2500 -n runback DLineArt 1 -l10 -c2500 runback DLineArt 9 -l30 -c2500 -n runback DLineArt 9 -l30 -c2500 -t runback DLineArt 4 -l3 -c1500 -n runback DLineArt -b -c2500 1 -l20 runback DLineArt -s -c2500 4 -l35 runback DLineArt "-TI love Teresa!" -c2500 9 -n -l20 runback DLineArt -e 7 -c1999 -l30 For speed freaks - run nil: DLineArt 9 -c4000 -l7 4) Miscelaneous: --------------- If you want to time the drawing speed (roughly) turn on the trailing option and wait for the screen to clear. 60,000 lines would have been drawn in this amount of time. I timed it at 2'7" (127 seconds) or 944 lines per second in line draw mode. Using boxes it climbs to 2400 vectors per second. Not too shabby for a game machine eh? 5) Future improvements: It could be faster, if I use the screen's rastport instead of the windows'. Unfortuneately, CED (which is an excellent editor) does not co-exist with DLineart when doing this. I have no clue why this is so. The only symptoms are that retrieving CED via hot-key produces an instant GURU. And no, I am NOT drawing out of bounds of the rastport, you should have seen the debugging code I put in to make sure of that! ------------------------------------------------------------------------ This program is PD. Use it or abuse it, only you will know. Steve -Raz- Berry (Note the new address) 1260 Ayala Dr. #214 Sunnyvale, Ca. 94086 UUCP: ...sun!kilowatt!raz ARPA: raz%kilowatt.EBay@sun.com If you are on USENET, please feel free to use the archive server on kilowatt. Just send a message of "send help" to the archive-server%kilowatt.EBay@Sun.com or {well bonded site}!sun!kilowatt!archive-server The archive has *all* of the binaries and sources that Bob Page has posted and some from the days of Pat White. Currently this totals to over 40 meg of stuff (zoo'ed and uuencoded). This program is a Public Domain product of The Checkered Ball 1989. 8/07/89 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.