ResetHandler V1.0 by FtC of EfS ------------------------------- A program that let's you execute DOS commands and/or display a warning when the user triggers a keyboard RESET. 1. Introduction --------------- "Well, to access the WordWrap function in my new text editor, I have to press CTRL-W-left Amiga-right Alt..." "... Rats! I've pressed right Amiga instead of right Alt! And now my text is lost!" If things like this happen often to you, ResetHandler is the right program for you. But also if you hate the fact that you have to quit manually certain programs every time before you reset, you should take a look at ResetHandler. But be aware: Contrary to IBM PC computers and clones (YEEK!), the keyboard reset of the Amiga *can't* be stopped, it can only be delayed. About 10 seconds after you've pressed the three magic keys, your Amiga will reset, no matter what happens. So don't blame me when you resetted your Amiga, realised your mistake, and tried to save the 100kb text you've been writing to floppy. However, if you owned a fast hard drive, it could have worked :-) 2. Usage -------- Before I explain the usage of ResetHandler, one thing first: This program will *not* run on all Amigas. Commodore designed the reset logic on the A500 (and perhaps other ones) differently than on the A1000, A2000, A4000 etc. ResetHandler will "run" on any Amiga equipped with at least Kickstart 2.0, but it won't do anything useful on an A500 (and very old Amiga 2000s, and perhaps other members of the Amiga family). There's nothing that can fix this "bug", it's hardware. Blame Commodore, not me. As I really don't know if it runs on A1200s, A600s and A4000s, you can do nothing but test it. Please report me (address at the end of the doc file) if it works or not if you are using such a machine. Better, if you happen to own an A4000 which you don't need anymore, send it to me :-) To activate ResetHandler, start it. If you run it from the Shell (CLI), you have to RUN it (no auto-detaching code), but it can also be run from the Workbench. Copying it in your WBStartup drawer, setting the tool types and forgetting all about it is perhaps the easiest way to use it. Started from the shell, its template looks like this: ResetHandler ShutDownCommand,Wait/N,NoWarn/S ShutDownCommand: This is the DOS command to execute when you trigger a keyboard reset. A script containing the DOS commands used to quit your constantly-running-applications will be appropriate most of the time, I think. Don't forget to prepend the name of the script with "Execute" in that case (example below). Wait: This argument accepts a number which will be used as a delay after the DOS command has finished. This is meant to be used together with the NoWarn option to give your hard drive some time to finish it's writing, for example. Note however that you've got only 10 (ten) seconds time after you've triggered the reset, so larger values than, say, 6 won't be of a big use. NoWarn: This switch turns off the warning requester. Examples: 1> Run ResetHandler This will start ResetHandler. When you press ctrl-lamiga-ramiga while ResetHandler is still running, it will pop up a requester telling you about what you've done and offering you the choice of resetting your Amiga or waiting. Remember that after you've triggered the reset, a hardware controlled 10-seconds timer starts to tick which *will* reset your Amiga, no matter what happens! So don't stare at the requester for too long, but either hurry and choose the "save" button of your word processor and pray that it will finish the "save" in less than 10 seconds, or press the button "Reset NOW!" on the requester and let it go. 1> Run ResetHandler "Execute S:CloseAll" Wait 4 NoWarn With "S:CloseAll" containing something like this: -----------8<--------------8<--------------8<--------------8<------------ FailAt 99999 C:CliExchange Kill MailManager Mail:bin/TrapTell Quit rx "Address Spot;QuitSpot NoReq" C:Cronevent q ----------->8-------------->8-------------->8-------------->8------------ (which is, incidentially, my personal config) This will start ResetHandler. When you trigger a keyboard reset, ResetHandler will execute this script, which will close (***commercial presentation***) MailManager, TrapDoor, Spot and TPTCron (***commercial presentation finished***) :-) After the script has finished, ResetHandler waits 4 seconds (to allow the hard drive to finish its writing) and finally, it will reset your Amiga. When you start ResetHandler from the workbench, you have to supply the arguments as tool types (just look at the icon contained in the archive). When ResetHandler is running, you can quit it by either send a CTRL-C or CTRL-D to its process, or you can kill it using Commodities Exchange. Using Exchange, you can also "Inactivate" and "Activate" ResetHandler as much as you wish :-) However, remember that ResetHandler will quietly let a reset happen when it's "inactive", and it won't do anything anymore when you've killed it (really?) If you run ResetHandler while it's already installed, it will terminate itself. 3. Why did I write this? ------------------------ Well, there was a friend of mine (Hi Denis!) who asked me if it's possible to prevent a keyboard reset on the Amiga. I answered "no, but..." and he had the idea of ResetHandler. So I did. Wasn't a bad idea! 4. To do -------- Anyone has any ideas? 5. Bugs ------- This program is written in a fully system friendly way. It uses keyboard.device's ResetHandler system (hence the name), and absolutely no hardware hacks. It shouldn't, under any circumstances, crash or cause directly any data loss. But remember that it may cause a DOS command to run while a reset occurs (if the DOS command runs long enough), which may even physically damage your hard disk. There's nothing you can do about this. Anyway, all programs have bugs. I didn't find any, but that doesn't mean anything. So if you find your Amiga behaves quite unusual, report the bug to me, please. I'll try to fix it ;-) Note again that this program *can't* work on A500s because their reset hardware is constructed *differently* from the hardware of other Amigas. And I really don't know if this program works on any Amiga but A2000s, but I think it should at least work on the "big box" Amigas (A3000, A4000). Don't blame me! 6. Disclaimer ------------- This program is © 1995 by FtC of EfS. All rights reserved. You may distribute this program as you like, but don't charge any money except some nominal fee for media. If this program does any harm to your hamster, your gold fish, your grandma or - most probably - your Amiga, I don't take any responsibility for it. And don't send me an assault command (nor a letter bomb) if the 10 second timeout occured while you were writing your 100kb textfile to your floppy (thus damaging it permanently). I'm not responsible for this timeout either. Donations (beer, girls, netmails, money, emails, amigas, ISDN cards, postcards, harddisks etc., no cars please - I can't drive) are always welcome... not required though as I think ResetHandler is quite a trivial program that didn't took much work. 7. The source ------------- I release the source code together with the program, but please don't tell me that my programming style is terrible: I already know it. To compile it, you'll need Wouter van Oortmerssen's excellent E compiler. It should compile without any problems under the demo version of EC 3.1a or newer, but a registered version won't hurt either :-) 8. History ---------- 131195 1.0 First released version 9. Contacting the author ------------------------ I can be contacted the following ways: Internet: ftc@p6.thotp.fn.alphanet.ch Fidonet: 2:301/317.6 Amiganet: 39:110/311.6 If you don't have any access to electronic mail, you may reach me at my postal address: Andreas Trottmann Kronengasse 7 CH-5400 Baden SWITZERLAND Enjoy ResetHandler!