DECUDK—User Defined Keys
DECUDK downloads definitions for user-defined keys.
|Ps1 ; Ps2 ; Ps3
|D . . . D
Key Definition String
|0 (default) or none||Clear all keys before loading new values.|
|1||Load new UDK values; clear old values only when redefined.|
When Ps1 is 1, the terminal only clears the keys you are loading. By using a Ps1 value of 1, you can redefine some keys without redefining them all.
There are 804 bytes of memory for all user-defined keys. A key definition can only use the number of bytes available when that key is loaded.
If Ps1 is 1, a key load may fail because no memory space is available. The reason for this is as follows:
With Ps1 set to 1, keys are cleared and loaded sequentially. If the new definition for a key is larger than the old one, then you may exceed the 804 byte limit.
For example, suppose F6 contains 412 bytes, F7 contains 366 bytes, and F8 contains 20 bytes. You try to load F8 with 40 bytes, F6 with one byte, and F7 with one byte, in that order. This works if all keys are cleared first (Ps1 is 0), but not if keys are cleared one at a time (Ps1 is 1). When you try to load F8 with 40 bytes, the load fails because only 26 bytes are free at that time.
804 (maximum) - 412 ( F6 ) - 366 ( F7 ) = 26
is the lock parameter. Pl determines whether the key definitions are locked or unlocked after you load them.
|0 or none||Lock the keys. If you want to load new values into the keys, then you must unlock the keys by using Set-Up.|
|1||Do not lock the keys against future redefinition.|
If Ps2 is 1 and the keys are already locked, then nothing happens.
The terminal uses a special lock to prevent or allow the programming of user-defined keys. You can turn on this lock from Set-Up or from the host (with a DECUDK device control string). The lock affects all programmable keys. When you use the lock, you should follow these guidelines:
- Unlock the keys to define them.
The keys must be unlocked before you can define them. You can only unlock the keys from set-up. If a key is locked and an application tries to redefine the key with a DECUDK sequence, then the terminal ignores the sequence.
- Lock the keys to prevent redefinition.
You can lock the keys from Set-Up or from the host by sending a DECUDK sequence. New key definitions are locked by default.
is the modifier parameter. Ps3 designates whether the key is shifted or unshifted.
|0, 2, or none||Defines the shifted function key.|
|1||Defines the unshifted function key.|
|3||Defines the alternate unshifted function key.|
|4||Defines the alternate shifted function key.|
is the final character. The vertical bar (7/12) identifies this control string as a DECUDK.
D ... D
are the key definition strings such as:
Key1/Mod1/Function #/UDS/UDS Direction;
Key2/Mod2/Function #/UDS/UDS Direction;........;
You include these strings between the final character ( | ) and the string terminator (ST). Each string consists of a key selector number (Kyn), a string parameter (Stn), a slash (/) (2/15), and a direction (Dir). A semicolon (;) (3/11) separates different strings.
- Kyn is the key selector number of the key you are defining. Tables 5–11 and 5–12 list the definable keys and their identifying values. Table 5–13 compares the function keys on the VT keyboard to equivalent keys on the PC keyboard.
- Stn is the string parameters, which are the encoded definition of the keys,
consisting of hex pairs in the following ranges:
3/0 through 3/9 (0 through 9)
4/1 through 4/6 (A through F)
6/1 through 6/6 (a through f)
When you combine these hex values, they represent an 8-bit quantity.
This method lets you use any of the 256 character codes in the key string. You can enter key definition strings in any order.
Default: Empty. The key is undefined.
Dir is the user-defined sequence (UDS) direction.
Dir Direction UDS is sent to . . . 0, none Normal Host and/or the terminal, depending on the setting of the COMM mode parameter. The UDS is directed to:
- The host for full-duplex mode.
- The screen for half-duplex mode.
1 Local Terminal screen only. 2 Remote Host only.
Default: None (Normal)
|Kyn||Pm = 1||Pm = none, 0, or 2|
Pm values of 3 and 4 are specific to the PC keyboard. They are ignored when you use a VT keyboard.
|1||None, 0 or 2||3||4|
DCS (9/0) indicates the beginning of a device control string. DCS is an 8-bit C1 character. You can use ESC P (1/11 5/0) for a 7-bit environment.
ST is the string terminator. ST (9/12) is a C1 8-bit character. You can use ESC \ (1/11, 5/12) for a 7-bit environment.
General Guidelines When Loading UDKs
Clear UDK memory space before loading new definitions.
Use a DECUDK string to clear keys without locking them. Then you can use another DECUDK string to redefine the keys and lock them.
- If you redefine a key, then the old definition is lost. This clears space if the new definition uses less bytes than the old one.
There is only one way to unlock UDKs.
To unlock a UDK, use Set-Up.
- When you clear a UDK, the key definition is empty.
An invalid hex pair in a DECUDK string stops a UDK sequence.
When a load sequence stops (error or other cause), the terminal saves keys already loaded and sends the rest of DECUDK to the screen.
- You can disable the local function keys by redefining them with DECUDK.
- DECUDK works in all VT modes except VT52 mode.
Examples of DECUDK Device Control Strings
The following sequence clears unshifted UDKs:
DCS 0 ; 1 ; 1 | ST
The following sequence locks unshifted UDKs:
DCS 1 ; 0 ; 1 | ST
Suppose you want to define the unshifted F20 key to be "PRINT", without clearing or locking any other keys. The first part of your sequence would look like this:
DCS 1 ; 1 ; 1 | 3 4 /
34 is the code for the F20 key.
After the slash character (/) (2/15), you include the definition. The rest of the sequence after the slash character would look like this:
5 0 5 2 4 9 4 E 5 4 ST
The hex encoding for "PRINT" is as follows:
The ST character (9/12) marks the end of the control string:
DCS 1 ; 1 ; 1 | 34 / 50 52 49 4E 54 ST