1 KEYDEFINE
KEYDEFINE.COM is a  DCL procedure to  downline load the programmable 
function keys of a VT200-series terminal. If the key_number parameter
is omitted, the user is prompted for an appropriate key number, and 
then a character string to store in the key.  Entering a key_number
without a key_string clears the key definition.

To use, first say:  $ KEY*DEFINE :== @SYS$RNA:[UTIL]KEYDEFINE.COM
then say:           $ KEYDEFINE  key_number  "key_string"

On-line help is available by entering a "?" instead of a key number. 
2 Parameters
KEYDEFINE takes two optional parameters. 

    $ KEYDEFINE [Key_Number] ["Key_String"]

Key_Number is the index number of the programmable key to download.

"Key_string" is the string to be stored.  Valid string entries can be 
any alphanumeric.  Lower case  characters must  be enclosed in double 
quotes, or DCL will upper case them.   

See subtopic "Key_Number" for a list of valid key numbers.
See subtopic "Key_String" for more information on control characters.
2 Key_Number
 Valid key numbers are:

 17     to designate shifted F6        28     to designate shifted HELP
 18     to designate shifted F7        29     to designate shifted DO
 19     to designate shifted F8
 20     to designate shifted F9        31     to designate shifted F17
 21     to designate shifted F10       32     to designate shifted F18
                                       33     to designate shifted F19
 23     to designate shifted F11       34     to designate shifted F20
 24     to designate shifted F12
 25     to designate shifted F13
 26     to designate shifted F14

See subtopics "Key_String" and "Usage_Notes" for more information.
2 Key_String
Valid string entries can be any alphanumeric.  Lower case characters
must be enclosed in double quotes, or DCL will upper case them.   If
key_string is a single uppercase word, then the enclosing quotes may
be omitted. 

Control characters can be stored in the keys by using the "caret/char"
convention. For example, ^M designates carriage return,  ^[ designates 
escape, ^A designates ascii character "0/1",  ^J is a line feed, ^L is 
a form feed, etc. 
2 Usage_Notes
VT200 series terminals have fifteen programmable function keys on the
top row of the keyboard: F6 through F14, DO, HELP, and F17 through F20.

When the terminal is in VT200 mode, you can download one or more key 
sequences by using DECUDK device control strings or the KEYDEFINE.COM
command procedure.

To access the programmed values of the keys you type SHIFT-(Func_Key).
To access the normal control sequence response you type the function
key alone. The character strings are stored only in the "shifted" key. 

There are  256  bytes available to the  15 programmable function keys.
Space is supplied on a first-come, first-serve basis.  After 256 bytes
are used,  you cannot  redefine  any more  keys until you clear space.

The KEYDEFINE.COM  procedure  always uses a download format which loads 
the new key definition before clearing the old one, thus a key load may 
fail because  the intermediate  storage requirements  exceed 256 bytes, 
even though the final storage requirements would have been 256 bytes or 
less. If this becomes a problem, simply clear the key definition before 
reloading the full string.

All key definitions are stored in volatile RAM, and are therefore lost 
when the terminal power is turned off. 

The KEYDEFINE.COM procedure does not support any of the locking or 
unlocking features of downloaded keys,  and leaves the definitions 
unlocked by default.  If key definitions become accidently locked,
you must enter terminal SET-UP mode to unlock them.
