home *** CD-ROM | disk | FTP | other *** search
-
- DDKEY version 1.1
-
- A Dynamic DOS Key expander: a tiny but powerful macro
- utility. This version has an enlarged 1440 byte buffer, with
- a default setting of 36 keys each allotted 40 bytes. It is
- very useful for complementing WordStar's anemic macros, as
- the included file WS.KEY demonstrates.
-
- This update adds a no translate key, ^@, to return the
- literal value of a defined key, allows variable entry within
- a macro with "Alt -", and allows chaining to another macro
- with "Alt =". The program no longer terminates a definition
- when all bytes are filled, but waits for input, in case you
- wish to backspace and chain to another macro. A definition
- line is now blanked initially, to avoid onscreen clutter.
- You may now write the key allotment value to an otherwise
- empty file.
-
- DDKEY becomes memory resident at slightly under 3k. Only
- the first parameter on a command line will be acted upon.
- Currently, the display is geared toward an 84 key, AT-style
- keyboard, and a non-enhanced bios.
-
- A>DDKEY to install.
- A>DDKEY /U to uninstall. Delimiter is "/" or "-".
-
- A>DDKEY /L FILESPEC load a key definition file. If
- ddkey is not installed, it will be.
- Example: ddkey /l ws.key
-
- A>DDKEY /S FILESPEC save a key file.
-
- A>DDKEY show definitions active in memory. The
- program will only install once.
-
-
- ON-THE-FLY DEFINITIONS
-
- The hot key is Alt =. You will be prompted for a key.
- All editing is done with either "Backspace" or "Carriage
- Return." To end a session: hit "Return" when prompted for a
- key. To clear a definition: hit "Return" after the equals
- sign. To terminate a definition: hit "Return." To delete
- left: use "Backspace." Most of this should seem fairly
- intuitive. To enter either of these keys in a definition
- itself, use the control equivalent, ^H or ^M.
-
- When the bytes allocated for a definition are filled,
- the program will beep. Either terminate the definition with
- a "Return," or else backspace and edit the macro or use the
- chain-to-macro feature discussed below. If the program
- refuses input, but does not beep, it probably means you are
- trying to enter a two-byte extended character, such as a
- function key or Alt key, when there is only one byte of
- definition space remaining.
-
- Clear all definitions
-
- The hot key cannot be redefined, so entering Alt = in
- response to the key prompt will give you a y/n choice of
- clearing all definitions from memory.
-
- Variable entry
-
- If Alt - is entered in a definition string, it will
- cause the macro, when executed, to pause for user entry. All
- entered keys will be literal. Terminate variable entry with
- "Return." This can be useful in DOS for entering file names
- in a command line. The "Alt -" key may be thought of as a
- string of dashes, or as an underline for a fill-in-the-blanks
- type of entry.
-
- Chain to another macro
-
- End a macro with "Alt =" and then the key you want to
- chain to, for example: <Alt =><Alt G>. DO NOT chain a macro
- to itself. Chaining to an Ascii key requires three bytes.
- Chaining to an extended key requires four bytes. Since only
- one byte is reserved for Ascii keys, the keypad numerals and
- symbols will appear as duplicates. If, say, both the
- keyboard "*" and the keypad "*" are defined, then issuing an
- <Alt =>* will result in chaining to the "*" which occurs
- first in the definition queue (nearest the top in the screen
- display). Note that clearing a key definition, and then
- redefining it will result in that key appearing last in the
- definition table.
-
- Exit code
-
- After keys are defined an exit code is sent. The default
- setting is ^@ which causes DOS to redisplay its prompt. To
- use this program in WordStar change the exit code to ^\,
- which will automatically clear the screen of garbage. DON'T
- use ^@ in VDE, as you may have to abandon your work. VDE
- also accepts ^\. The exit code is located at address 01B9.
-
- The key is exactly specified with both the Ascii code and
- the Scan code. This is the typical reversed order of all two-
- byte values, such as addresses, in DOS. Obtain the codes
- from a table, or better, use KEYCODE, an accompanying
- utility. Note that KEYCODE correctly returns the Scan code,
- then the Ascii code, so these two hex bytes must be reversed
- when entering with Debug. The suggested codes, with Ascii
- listed first are:
-
- Place at 01B9: ^@ 00 03 - DOS
- ^\ 1C 2B - WordStar or VDE
-
- ^@ will work in WordStar, but it won't clear the screen,
- and ^\ will work in DOS, but you will have to press "Escape"
- and "Return" to redisplay the DOS prompt after creating
- definitions.
-
- Literal key
-
- When typing use ^@ (typed by user--no connection to the
- exit code) to return the next struck key as a literal, even
- if it was previously defined. This applies to "Alt =" and to
- ^@ itself. The ^@ key is the old teletype NUL, and may be
- thought of as nullifying any definition.
-
-
- THE KEYPAD DEFINITIONS: WS.KEY
-
- The included definitions are for the keypad of the 84 key
- AT-style keyboard. The 101 key enhanced keyboard probably
- has the keypad too far to the right for rapid-fire editing,
- though similar definitions could be place on the overhead
- function keys. Another use of the keypad would be to hold
- formatting code for writing screenplays. In WS.KEY the key
- interval value is not 40, but 32, which means 45 keys may be
- defined, leaving 30 free for the user.
-
- Paragraph:
- Begin/Previous Next Mark Mark to end
- (7) (8) (9) (*)
-
- Sentence:
- Begin/Previous Next Mark Mark to end
- (4) (5) (6) (-)
-
-
- Quick Down Quick Across Go Marker
- (1) (2) (3)
-
-
- Delete Word Left Place Marker Mark word
- (0) (.) (+)
-
- ^Backspace also gives "delete word left" (as in PC-Write).
-
- Of course, users of other word processors already have
- most of these commands available as part of their programs.
-
- Load DDKEY /L WS.KEY and look at the display. Most
- definitions will be self-explanatory. Quick down (1)
- generates a series of ^Xs, which WordStar can't handle:
- after the first ^X the rest are gobbled. Thus this string is
- preceded with the (undocumented) feature ^Q~ which forces
- WordStar to accept the macro as given, without losing
- keystrokes. Also, it may not be clear from the opening
- display, but "delete word left" is <space>^A^T. Without the
- initial space, the command might not only wipe out any mess
- to the left of the cursor, but also the word to the right.
-
- The definitions assume double-spaced text, with a
- WordStar added soft carriage return between paragraphs. To
- make them work with single-spaced text, with two hard
- carriage returns between paragraphs, make these changes:
-
- <Keypad 8> add ^F to end
- <Keypad 9> add ^F before final ^KK
- <Keypad *> delete ^A before final ^KK
-
-
- MODIFYING DDKEY
-
- Each key has 40 bytes allotted to it: 2 bytes for the
- key, 37 for the definition, 1 byte for the final 00. You may
- change the key allotment, using Debug on DDKEY itself. Then
- all future saved files will have your new chosen value. The
- address to change is 06FC, with a current value of 28 hex
- (40d).
-
- To use the 1,440 byte buffer efficiently, choose a value
- that evenly divides such as 5, 6, 8, 9, 10, 12, 15, 16, 18,
- 20, 24, 30, 32, 36, 40, 45, 48, 60, 72, 80, 90, 96 (decimal).
- If a number does not divide evenly, any remainder is unused.
- Decide on your required definition length and add 3, or
- simply choose a convenient value and use the chain-to-macro
- feature to handle long definitions.
-
- Change the byte at 06FC to 14 hex (20d) to create many
- small definitions, or to 50 hex (80d) to reassign keys with
- long definitions. Save definitions to a file. The key
- allotment is the first byte of the file. The default value
- may be reset, but any time a file is loaded, the key
- allotment reverts to the value of that file. (To avoid a
- mismatch, when you load a file all former definitions are
- deleted from memory. Only those in the file will be active.)
- To restore a default value, either read in a file, or
- uninstall the program, then reinstall it.
-
- Assume you wish to use DDKEY with WordStar, but dislike
- WS.KEY. You want to define virtual every Alt key,
- substituting Alt B for ^KB, Alt K for ^KK, Alt L for ^QR^QL,
- and so forth. To do so:
-
- DEBUG DDKEY.COM
- E 1B9 1C 2B ;after creating definitions, the
- ;code for ^\ will be sent. This is
- ;WordStar specific, and refreshes
- ;the screen
-
- E 6FC 10 ;10 hex = 16 decimal. This allows
- ;90 keys, enough for your needs,
- ;each with 13 bytes available for a
- ;definition string
- N WSKEY.COM
- W
- Q
-
- This creates a file, WSKEY.COM, to try out. Make a
- couple of new definitions and save to a file. Now you may
- change the key allotment to 50 hex (80d), and redefine 18
- keys for use in DOS. When you load the WordStar file the key
- allotment will be reset to 16d.
-
-
- TECHNICAL STUFF
-
- The whole choice of using key partitions has its
- advantages and disadvantages. It is very fast: the macro
- facility simply zips down the list looking for matches. And
- if you are making many small definitions it is very
- efficient. There are no reference addresses or length values
- to check. For instance, by choosing a key allotment of 5, the
- whole keyboard could be redefined to a Dvorak layout.
- Avoiding reference addresses saves a couple of hundred bytes
- in this situation. Note that defined keys are exactly
- specified with scan code and Ascii value, which means that
- the program distinguishes between keypad and keyboard keys.
- Within a macro, however, only the Ascii value is saved for
- most keys; the scan code is ignored. Most programs recognize
- a letter resulting from holding down the Alt key and entering
- the decimal Ascii code on the keypad. In such a case the
- returned scan code is zero. Also most text files save only
- the Ascii value. DDKEY does output scan codes (from a
- translation table) for all control characters, since WordStar
- needs these to differentiate keys.
-
-
- COMMENTS
-
- This program was inspired by two CP/M public domain key
- redefinition programs, GKEY by Eric Gans, and QWIKKEY by
- Anton Fleig. I was baffled that DOS required at least 20k to
- do what took less than 4k in CP/M. The name would have been
- DKEY, but that name was already taken.
-
- This utility is free for all personal and private use.
- Use at your own risk. I have no responsibility for any
- damage, incidental or otherwise, that may be caused by its
- use.
-
- If there are problems, please let me know. I do not
- have an enhanced keyboard so it may be a while before I adapt
- DDKEY for the enhanced BIOS, unless someone desperately needs
- it. I suppose anyone who sends money or who volunteers to
- serve as a guinea pig for a new program will be considered
- desperate.
-
- David M. Dibble
- 1133 Blaine Street, #112
- April 3, 1991 Riverside, CA 92507
-