Eric Gans French Dep't UCLA Los Angeles, CA 90024 GKX.DOC (Formerly GKEY2) v 3.90 01/30/88 Version 3.90 Allows reconfiguration of ESC (trigger) key and of macro buffer size. (Suggested by Benjamin Cohen.) Version 3.80 Adds option to change keyboard port number (in GKXSET). Fixes a bug in GKXS372. Version 3.72 Adds Kaypro-10 extensions, append file command (+), space for comments in GKX files. Renamed files to GKX.COM and GKXSET.COM to avoid confusion. Version 3.0 Uses ASCII files for macros. GKX files can be edited with a text editor. Allows reconfiguring "highbit" keys (keypad and arrow or function keys). Captures BIOS CONSTAT to allow long key strings in Wordstar and other word processors. Allows 1 K of memory for key storage. * * * GKX is a keyboard enhancement program that has several decided advantages over SMARTKEY and other commercial programs. - special extensions for Kaypro 10 allow undelete, case change and letter transpositions in Wordstar 3 and other word processors (new in v3.72) - stores macros in editable ASCII files (new in v3.0) - takes less memory space, leaving more for programs - loads and responds faster - can save key files, clear current settings, or take itself out of memory without the need for an auxiliary program - allows redefinition of escape sequences, thereby doubling the number of redefinable keys This last feature was the deciding factor in writing this program. After some experience with MS-DOS, where keyboard enhancers have so much more to work with, I was struck by the poverty of programs that are limited to the standard ASCII set, most of which cannot be redefined without great inconvenience. GKX allows the redefinition of + any key, thereby adding 127 configurable combinations few of which are ever used by application software. If ESC is not convenient for this purpose, v3.9 allows you to change it to another key (e.g., '~'). The general structure of the program is similar to SMARTKEY, although it is much simpler. To redefine a key, you use the "setup" key, originally defined as "|"; a "shift" key, originally defined as "\", allows you to use the original value of a redefined key. Unlike SMARTKEY, GKX lets you abort a redefinition by typing the shift key; you don't have to re- redefine. You can also reset a key by redefining it as nothing. GKX can load and save key files, clear current settings, and remove itself from memory. (You need only enter the filename; the program will supply the extension .GKX.) A companion file, GKXSET, can read current settings and change the setup and switch keys in GKX; it also includes some help information. (Unlike FIXKEY, GKXSET does not require GKX to be in memory at time of use.) GKX Commands: To redefine a key: [you will be prompted by "=" here] Typing the shift key at any point will abort the redefinition. To produce the original value of a redefined key: To load a key file: GKX fn(.GKX) To append a key file to current settings (duplicate keys will be overwritten): GKX fn(.GKX) + To save current settings in a file: GKX fn(.GKX) $ To remove GKX from memory: GKX - To clear current settings (leave GKX in memory): GKX # + is treated as a single key in these procedures. For example, the sequence: |B(=)blurk| will define B as blurk. (The "=" is a prompt added by the program, not typed by you.) To type a straight , either use the shift key or just hit the key twice. Up to 1024 bytes (default) are available for definitions, enough for nearly any conceivable use. If you get past the maximum you will get a beep while trying to redefine. Any single redefinition can contain as many as 255 characters. GKX's redefinitions are not cumulative: if you redefine B as blurk then if you redefine 1 as BLURK you really get BLURK, not blurkLURK. Version 3 of GKX allows you to reconfigure high bit keys like the Kaypro keypad and arrows, or function keys. In order to allow multi-character strings in Wordstar and other word- processors, GKX now sets the console ready (or CONSTAT) BIOS function active during the playback of such strings. It changes the BIOS CONIN address to "translate" keys as they are typed and fixes a few addresses to protect the program in the TPA. (SMARTKEY uses the CONOUT function to check for the BDOS address after Warm Boots; GKX uses the -- less often used -- SELDSK function.) Reconfiguring GKX The following items may be changed in GKX v3.90: the setup key (originally '|'); the shift key (originally '\'); the keyboard port number (originally 5); the "trigger" key for the second set of key redefinitions (originally ESC = 1bh); and the size of the macro buffer (originally 1024 bytes; may be set to anything between 100H = 256 and 400H = 1024 bytes). GKXSET allows you to do this without patching; or if you prefer, the bytes may be found in the first sector of the file: 102H 7C '|' = setup 103H 5C '\' = shift 104H 05 = keyboard port 105H 1B ESCAPE = trigger for second set of macros 106H 00 04 1024 = size of macro buffer GKX Files GKX Version 3 uses ASCII key files to store macros. This means that you can read these files on the screen and edit them with a text editor--a convenience borrowed from MS-DOS programs. If you save the current settings in a file, 25 spaces are reserved for comments for each redefine. The format of key definitions is as follows: char [comment] =def The character should be written as normally typed, except for the following: (char-80h) for "high-bit" characters over 127 (80h) char for + char char for + highbit ^char for control characters #D for #B (or ^H) for Backspace #S for #V variable length input (until CR) ## for # (see below for Kaypro 10 extensions) The same characters are used in the definitions, except that the and symbols are not permitted. A comment may be placed between the defined key and the equal sign. The definition must follow the equal sign directly. Each definition must be followed by a CRLF. Spaces may be included in the definitions, but if a definition ends with a space you should use '#S'. Maximum length is 255 characters. The easiest way to get started is to define a few macros and save the file; this will give you an idea of the file format (comments cannot be saved in this manner). ***************************************************************** !!! KAYPRO 10 Extensions !!! If you have a Kaypro 10 with the standard BIOS you should be able to use the following extensions. (If they won't work on your system, please let me know!) They have been set up to work with Wordstar v3.3, but they are not specific to any one word processor. *** If you DON'T have a Kaypro, DON'T use these characters in *** your key files. They depend on specific BIOS addresses and *** are guaranteed NOT to work on any other system! The enclosed file WS.GKX (sorry I forgot to include this in previous versions) gives examples of the possibilities of GKX for undeletion, case toggles, and letter transposition (the most common editing features left out of WS 3). #L get line at cursor #R restore saved line at cursor #W * get word at cursor #I * insert saved word at cursor #G get letter at cursor #P insert saved letter at cursor #C toggle case (upper/lower) of letter at cursor #U ** change user number #H *** delay to reset cursor position * Consecutive words saved at the same cursor position are saved cumulatively. This allows you move several words in the same line by deleting them (in WS using ^T), then undeleting them somewhere else. ** You are prompted with '>'. Enter the user number in HEX, that is, 0 - 9, and a - f for users 10 - 15. The user number will change immediately. This is handly if you have fixed old WS to keep its overlays in a single user area (using the patches WSUSER or WSUSR2) and want to edit files in different areas without reloading. *** This is useful in WS for commands that make use of the cursor position after a change (see WS.GKX for examples). It does not seem to be necessary in VDE, which updates the cursor much faster.