PMDF User's Guide
OpenVMS Edition


Previous Next Contents Index


DEFINE

Bind a command to a sequence of one or more keyboard keys.

Syntax

DEFINE key-sequence [string[,...]]

Qualifiers Defaults
/ECHO /ECHO
/IF_STATE=state /NOIF_STATE
/KEY None
/LOCK_STATE /NOLOCK_STATE
/LOG /NOLOG
/SET_STATE=state /NOSET_STATE
/TERMINATE /NOTERMINATE

Parameters

key-sequence

The key sequence which, when typed, should be replaced by string or induce the specified state change, or both.

string[,...]

Optional list of one or more strings (e.g., commands) to bind to the specified key sequence. When more than one string is specified, the strings will be delimited by carriage returns.

Description

The DEFINE command allows arbitrary strings of text to be bound to specified keyboard sequences. When the specified keyboard sequence is input, it is replaced by the bound text strings. This allows command definitions to be established. For instance, the definition


EMAIL> DEFINE CLEAN "MOVE/REPLIED OLD_MAIL","DIRECTORY NEWMAIL"/TERMINATE
EMAIL> 
causes the two commands MOVE/REPLIED OLD_MAIL and "DIRECTORY NEWMAIL" to be issued whenever CLEAN is typed.

The DEFINE/KEY command provides a convenient way to bind text strings to specific keyboard keys. When /KEY is specified, the key-sequence parameter should be the name of a single keyboard key. The accepted names are any single keystroke (e.g., "a", "A", "~", etc.), or any of the special names assigned to the function, editing, cursor, or keypad keys shown in the table below:
F1---F20 Function F1---F20 keys
PF1---PF4 Keypad PF1, PF2, PF3, and PF4 keys
KP0---KP9 Keypad 0---9 keys
PERIOD Keypad . key
COMMA Keypad , key
MINUS Keypad - key
ENTER Keypad Enter key
DO, HELP Help and Do keys (F15 and F16)
E1, FIND Find key
E2, INSERT_HERE Insert Here key
E3, REMOVE Remove key
E4, SELECT Select key
E5, PREV_SCREEN Previous Screen key
E6, NEXT_SCREEN Next Screen key
UP, DOWN Up and down cursor keys
LEFT, RIGHT Left and right cursor keys

Bindings made with the DEFINE command are only honored at the EMAIL> command prompt. They have no effect at other prompts (e.g., Subject:) or while composing a message.

Note

Unlike the VMS MAIL DEFINE/KEY command where an empty string, "", must be used for bindings with no bound string, with PMDF MAIL you must omit the bound string parameter altogether.

Qualifiers

/ECHO (default)

Specifies whether the bound text string is echoed after the associated key sequence is input. While /NOECHO is accepted, it is ignored.

/IF_STATE=state[,...]

/NOIF_STATE (default)

Specifies a list of states, any one of which must be set in order to enable the specified binding. If this qualifier is omitted or negated, then the current state prevails.

/LOCK_STATE

/NOLOCK_STATE (default)

Retains the state specified with the /SET_STATE qualifier until another /SET_STATE qualifier is used to change it. The default is /NOLOCK_STATE.

/LOG

/NOLOG (default)

Specifies whether informational messages are displayed when a binding is successfully made.

/SET_STATE=state

/NOSET_STATE

Associates a state with the keyboard binding being defined. When the binding is used (i.e., when key-sequence is input), then the current state will be set to the specified state. If this qualifier is omitted or negated, the state remains unchanged when the binding is used. /SET_STATE and /TERMINATE cannot both be used by a single binding. The state is always cleared by a binding with /TERMINATE.

/TERMINATE

/NOTERMINATE (default)

Determines whether a carriage return is issued after expanding a keyboard binding. That is, whether the result of the binding is executed as a command when you input the associated keyboard sequence. When /NOTERMINATE is used, you must press [RETURN] to execute the command line. /SET_STATE and /TERMINATE cannot both be used by a single binding. The state is always cleared by a binding with /TERMINATE.

Examples

#1

EMAIL> DEFINE/KEY F17 DIRECTORY
EMAIL>
      

This example illustrates how to bind the DIRECTORY command to the F17 function key. When that function key is pressed, "DIRECTORY" will appear on the command line after which you can either press [RETURN] to issue the command or enter a folder name followed by [RETURN].

#2

EMAIL> DEFINE/KEY F18 "DIRECTORY MAIL"/TERMINATE
EMAIL>
      

This example illustrates how to bind the command "DIRECTORY MAIL" to the F18 function key. When that function key is pressed, the DIRECTORY MAIL command will be issued. Because of the space in the DIRECTORY command, the command was enclosed in quotes.

#3

EMAIL> DEFINE/KEY F11 "PRINT/TERMINAL=PRINTER_PORT"/TERMINATE
EMAIL>
      

This example illustrates how to bind the command "PRINT/TERMINAL=PRINTER_PORT" to the F11 function key. Because of the slash, /, in the PRINT command, the command was enclosed in quotes.

#4

EMAIL> DEFINE/KEY F11/SET_STATE=READING/LOCK_STATE READ
EMAIL> DEFINE/KEY F18/IF_STATE=READING "REPLY/EXTRACT/ALL"/TERMINATE
EMAIL> DEFINE/KEY F19/IF_STATE=READING "FILE"
EMAIL>
      

This example illustrates the use of states to establish key definitions which are effective only if the key F11 is first pressed.


Previous Next Contents Index