APPLICATION NOTE #167 RECORDING KEYSTROKES ON A SAVE/GET KEY Related file: CAPTURE.PGM Rev. 02 CAPTURE.PGM is a program that records a series of keystrokes as you type them and saves the series to a save/get key. You can then use the save/get key to recall the captured keystrokes as many times as you want, whenever you want. (CAPTURE.PGM is available on the disk that accompanied this application note.) This application note describes * using CAPTURE.PGM * terminating the procedure * recording keystrokes permanently * changing the save/get key * including ASCII characters with your recorded keystrokes USING CAPTURE.PGM To use CAPTURE.PGM, first load it to a save/get key. Type: F5ldpm capture.pgm,c The program is designed to be loaded onto the C key. If you prefer another key, follow the procedure described in the section "Changing the Save/Get Key" and then adjust the Load Program (LDPM) command line accordingly. When you want to capture a series of keystrokes, press the save/get key to which you have loaded CAPTURE.PGM. Press: Alt C The program displays the message, "Recording; press hot key when done." Every key you press is recorded, whether the key produces a character or performs a function (such as F5, which blanks the command line, or F9, which executes a command). If you make a mistake and then correct it, the program records both the mistake and the correction. When you have finished typing the sequence you want to capture, press the save/get key again. Press: Alt C The program displays the message, "Where do you want to save keystrokes? Press A-Z or 0-9". Choose the key you want to assign to the series of keystrokes: A-Z or 0-9. To save to the X key, for example: Press: x NOTE: Do not save your keystrokes to the same key to which you loaded CAPTURE.PGM. Result: The program displays the message, "Press ALT-X to recall keystrokes." Any keystrokes previously saved to save/get key X (if any) are erased, and the series of keystrokes you recorded is saved to that key. If you want to save new keystrokes to key X, repeat the procedure. The new text replaces the previous series. To recall the captured keystrokes, press Alt and the letter or number you chose. For example: Press: Alt x TERMINATING THE PROCEDURE If you start the recording procedure and then change your mind, press the save/get key to which you have loaded CAPTURE.PGM in order to terminate the program. If you did not press any other keys between starting and stopping the procedure, you need not do anything further. However, if you were recording keystrokes, you must tell XyWrite to discard the sequence you started to save. When XyWrite displays the message, "Where do you want to save keystrokes? Press A-Z or 0-9," press the minus key instead of a number or a letter. Press: - Result: CAPTURE.PGM displays the message, "Nothing recorded," and clears all the keystrokes from memory. RECORDING KEYSTROKES PERMANENTLY The keystrokes you save are temporary; they are lost as soon as you QUIT XyWrite or load another save/get to the same key. To save the series of keystrokes permanently, use the STSGT (Store Save/Get Keys) command. This stores the set of current Save/Get keys in memory to a file you specify. Then you can reload the set into memory whenever you want by using the LDSGT (Load Save/Get Keys) command. To store Save/Get keys to disk: Type: F5stsgt filenameF9 filename identifies the file on disk to which you want the save/get keys stored. To reload the save/get keys from the disk: Type: F5ldsgt filenameF9 filename is the file on disk from which you want the save/get keys recalled. CHANGING THE SAVE/GET KEY Use the following procedure to load CAPTURE.PGM to a save/get key other than the C key: 1. Use the CAP command to call CAPTURE.PGM to the screen. Type: F5cap capture.pgm 2. Switch to expanded mode. Press: Ctrl F9 3. On the second line of the file, find the @C function call and put your cursor on the @ character. 4. Move to the command line and use the PFUNC command to assign the function call to the key you want to use. For example, the following command line assigns the function call to the N key. Type: F5pfunc @n Result: A bold @N appears in the program file. 5. Delete the @C that remains in the file. Press: Del 6. Store the file. Type: F5st 7. Reload the CAPTURE.PGM to the new save/get key. Type: F5ldpm capture.pgm,n INCLUDING ASCII CHARACTERS WITH YOUR RECORDED KEYSTROKES Normally, you type an ASCII character on the screen by pressing AltShiftand typing the number of the ASCII character. However, if you want to include an ASCII character in your recorded keystrokes, you also press the letter "a" to make the character appear on the screen and to record it properly. For each ASCII character you type while capturing keystrokes: Press and hold: Alt Shift Use the number keys on the alphanumeric keyboard (rather than the numeric keypad) to type the ASCII number. For example, to enter ASCII 20: Type: 2 0 Release: Alt Shift Type: a Result: ASCII 20 (the paragraph symbol) appears on the screen and is recorded in the program. The "a" is not recorded; it is only a signal for CAPTURE.PGM.