MouseCMD SETUP ============== The first thing to do, after you've tried the demo configuration file, is to define your own commands by writing your own config file. You do this with any text editor, such as Ed. You may find the following discussion easier to understand if you look at a printout of the accompanying example configuration file "MouseCMD.cfg" The first four values in the config file relate to setup options. The first is a "magic number" value of 99 which identifies this to MouseCMD as a valid configuration file. This helps to avoid the nasty results that may develop if you accidentally specify some other sort of file. MouseCMD MUST find this value first (after any comments). The next two values define the number of command sets for which you wish to reserve memory: first, the number of fixed-command sets (each set consisting of 10 commands), then the number of variable command sets (consisting of 6 commands). The fourth value specifies how many characters to allow for each command (minimum is 10). Since memory is allocated only as required, these values allow you some control over how much memory the program will use. You get the program's default values by providing -1 for any particular setup value, except the "magic number". These defaults give you 1 command set of each type and 40 characters for each command. You MUST provide these first four values. Next you define the commands and buttons themselves. You need not define all the buttons, and you may define them in any order. You use an ID number for each command that you define. This ID is derived as follows: 1) The first character, if present, is always a number and represents the command set into which this command will go. 0 through 9 are acceptable command set numbers, although a 0 is not required for the first (or only) command set. 2) The second character represents the command button within the command set. The fixed-command buttons are labeled 0 through 9. The variable command buttons are labeled A through F. Acceptable button ID's, then, are: 0 1st fixed-button, set 0 0F 6th variable-button, set 0 00 1st fixed-button, set 0 3C 3rd variable-button, set 4 A 1st variable-button, set 0 99 10th fixed-button, set 9 The fixed-command buttons take three values: 1) the button ID (see below), 2) the text that appears on the button, up to 5 characters, and 3) the command text associated with the button, maximum length defined by you. The variable-command buttons, permanently named A-F, take only 2 values: 1) the button ID (see below), and 2) the command text associated with the button, which appears in the string gadget, maximum length defined by you. You may optionally specify a button color scheme at the end of either a fixed- or a variable-command definition by appending first the button's background color, then it's text and border color. Allowable color numbers are 0 through 3 and correspond to the Workbench screen colors (defaults: 0=Blue,1=White,2=Black,3=Orange). Note that this color scheme applies to ALL buttons of the SAME TYPE in a particular SET. You need only add the color definition to 1 command in any set. If you define colors more than once for a set, only the last definition will be used. If you don't specify colors, the default colors will be used. The default color set provides a different color scheme for each command set. You can write comments into the file by preceeding them with a semi-colon, but do not put any more command values on the same line. The text reader portion of the program, after finding a semi-colon, reads to the end of the line before accepting more values. Values are separated by commas. There are four other reserved characters, in addition to the comma and semicolon described above: 1) The tilde character (~) is used to indicate a press of the RETURN key. For example, the command CD DF0:~ will execute immediately. 2) The caret symbol (^) is used to indicate that the character following it is being pressed simulaneously with the CONTROL key. For example, the command ^X is equivalent to CONTROL-X, and erases the current line (no RETURN keypress is required). 3) The ampersand symbol (&) is used to indicate an ESCAPE key press. For example, the command: &[3m~ switches the character set to italics (&[0m~ switches back to normal). 4) The at symbol (@) is used to delineate absolute keycodes. This is not only a way to get a reserved character into the command string, but more importantly, it allows "pressing" any key, or combination of keys on the keyboard, including CONTROL, ALT, and either or both of the AMIGA keys. A "rawkey" sequence looks like this: @<63>28@ The values are raw key codes (in 8-bit hexadecimal, i.e. 2 characters per key code). Note that the sequence begins and ends with the @ symbol. From the table below you can see that 63 corresponds to the CONTROL key, and 28 corresponds to the L key. The command above is equivalent to CONTROL-L, and clears the screen. It obviously could also have been written: ^L. It could also have been written: @<63>@L. Qualifier keys (key code numbers 60 through 67, CTRL, ALT, SHIFT, AMIGA, etc.) must be enclosed in angle brackets. They affect the next non-qualifier key found. In this way, it is possible to "press" several qualifier keys at once (CTRL-SHIFT-ALT): @<636064>K@ A number of programs, particularly text editors, use an incredible variety of keypress combinations to invoke their commands. MouseCMD can shield you from having to remember all of these combinations, and can even provide a common base if, for example, you happen to use several text editors, each with a different command to do the same operation. The rawkey sequence also allows you to "press" any of the function keys, the help key, delete, backspace, etc. RAW KEY CODES This is the keyboard. Raw key codes are below the key names. ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 DEL 45 50 51 52 53 54 55 56 57 58 59 46 ` 1 2 3 4 5 6 7 8 9 0 - = \ BS 7 8 9 00 01 02 03 04 05 06 07 08 09 OA 0B 0C OD 41 3D 3E 3F TAB Q W E R T Y U I O P [ ] RTN HLP 4 5 6 42 10 11 12 13 14 15 16 17 18 19 1A 1B 44 5F 2D 2E 2F CTL CL A S D F G H J K L ; ' UP 1 2 3 63 62 20 21 22 23 24 25 26 27 28 29 2A 4C 1D 1E 1F SFT Z X C V B N M , . / SFT LFT RHT 0 . 60 31 32 33 34 35 36 37 38 39 3A 61 4F 4E 0F 3C ALT LFT-A SPACE RHT-A ALT DN - ENTER 64 66 40 67 65 4D 4A 43 USING MouseCMD ============== To be found by MouseCMD, the config file you have written must be in either the current working directory or the S: directory. It can have any name. To begin MouseCMD using a config file named "MouseCMD.cfg" enter from the keyboard, or place in your startup-sequence: RUN MouseCMD MouseCMD.cfg Here is a rundown of what is available in the MouseCMD window: 1) The CLOSE GADGET in the upper left corner ends the MouseCMD program. 2) A DRAG BAR is located under the window title "MouseCMD". Use this to slide the window around on the screen. 3) The text following WDW: is the name of the window currently accepting output from MouseCMD. When MouseCMD begins from the CLI, its output goes to the window named "AmigaDOS". To change the output to another window, see below. The text following WDW: is abbreviated, if necessary, to 8 characters. If the window accepting output has no name, ">>NoName" is substituted. 4) Following FREE MEM is the current free memory available in the system. 5) To turn the memory display on or off, click on the MEM gadget at the end of the title bar. This gadget also has another function. If an error occurs, the error message is displayed in the title bar, where the memory display would normally be. To get rid of the error message, click on the MEM gadget. This will return you to the previous title bar state before the error (mem display, or no mem display). Note that this does not correct the condition that caused the error, however. The error message will return on the next try, if not corrected. 6) You may find the window DEPTH ARRANGEMENT gadgets in the upper right corner useful for positioning the MouseCMD window over another window that will receive its output. 7) Clicking anywhere on the title bar between WDW: and the Depth Arrangement gadgets invokes the TINY WINDOW. The main MouseCMD window closes, and the Tiny Window opens at the position defined in the config file. The Tiny Window waits until you to click in its window area, then closes, reopening the MouseCMD window where it was when you closed it. 8) Just below the title bar are the 10 FIXED-COMMAND gadgets, labeled with the names you gave them in the config file. 9) Next below, in two rows, are the VARIABLE-COMMAND gadgets labeled A through F, next to their respective string gadgets which contain the actual commands you gave them in the config file. On the right side of the window are 3 last gadgets: 10) The 2 gadgets labeled "<--" cycle through the command sets you have defined. The top gadget cycles the fixed command buttons; the middle gadget cycles the variable commands. Cycling the command sets seperately allows for a lot of versatitlity. For example, you can use the fixed- command sets for commands you normally use, and the variable command sets for filenames that you use a lot. 11) The WDW gadget allows for switching the output of MouseCMD to another window. After clicking on the WDW gadget, output switches to the next window you click on. The window's title will appear on MouseCMD's title bar. That's about it. I hope you find the program useful. I use it quite a bit, mainly in doing repetitive compiling and setting up compiler options. It works, as far as I know, with no problems, but I haven't really abused it. Let me know if you have any problems or suggestions. Bruce Schuldt 630 SW Coral Junction City, OR 97448 (503)998-6418