contents.gifprev1.gifnext1.gif

DEFINE_KEY

Description:

DEFINE_KEY ties statements to a single key or sets of keys by binding executable code to a specific key or combination of keys. There can be only one definition per key per key-map. The first parameter is the program or text to be executed each time the defined key is struck. The second parameter is the keyword of the key to be defined. The third parameter is optional and provides a comment or nickname of the key being defined. The last parameter, also optional, specifies which key-list or key-map to add the definition to. If no key-map or key-map-list is provided, the defined key is added to the first key-map of the key-list bound to the current buffer.

Syntax:

DEFINE_KEY ( executable, key-name )

DEFINE_KEY ( executable, key-name, comment )

DEFINE_KEY ( executable, key-name, comment, key-map )

Valid executable types are: Buffer, Learn, Program, Range, or String.

Example:

The following assigns the MOVE_VERTICAL (1) function to the DOWN key and gives it the label DOWN_KEY.

DEFINE_KEY ("MOVE_VERTICAL (1)", DOWN, "DOWN_KEY");

Errors:

TPU$_BADKEY Invalid keyword.

TPU$_COMPILEFAIL Compilation incomplete due to syntax errors.

TPU$_EMPTYKMLIST No key-maps in list.

TPU$_KEYSUPERSEDED Key definition superseded.

TPU$_NOKEYMAP The string is not a key-map.

TPU$_NOKEYMAPLIST Invalid key-map-list-name.

TPU$_NOTDEFINABLE Invalid second argument.

TPU$_RECURLEARN Learn recursion is illegal.

TPU$_UNKKEYWORD Keyword not recognized.

Related Builtins:

CREATE_KEY_MAP

CREATE_KEY_MAP_LIST

LOOKUP_KEY