contents.gifprev1.gifnext1.gif

KEY_NAME

Description:

KEY_NAME returns the unique keyword for any given key. For the first parameter, integer represents the value of the keyword for a specific key. KEY_NAME works with the following keynames:

BS_KEY COMMA CTRL_A_KEY CTRL_B_KEY CTRL_C_KEY CTRL_D_KEY

CTRL_E_KEY CTRL_F_KEY CTRL_G_KEY CTRL_H_KEY CTRL_I_KEY CTRL_J_KEY

CTRL_K_KEY CTRL_L_KEY CTRL_M_KEY CTRL_N_KEY CTRL_O_KEY CTRL_P_KEY

CTRL_Q_KEY CTRL_R_KEY CTRL_S_KEY CTRL_T_KEY CTRL_U_KEY CTRL_V_KEY

CTRL_W_KEY CTRL_X_KEY CTRL_Y_KEY CTRL_Z_KEY DEL_KEY DO

DOWN ENTER E(1-6) F(1-40) FS_KEY HELP

KP(0-9) LEFT LF_KEY MINUS NULL_KEY PERIOD

PF(1-4) RET_KEY RIGHT RS_KEY TAB UP

US_KEY

When the first argument is a string, it must be a single character value of a key from the keyboard. The string values are case-sensitive. The second parameter is used for alternate states of key presses to be defined. If the SHIFT_KEY modifier is used with the letters A-z, the returned key is case-insensitive.

Syntax:

keyword := KEY_NAME ( { integer | keyname | string} [, modifiers ] )

Valid modifier keywords are: SHIFT_KEY, ALT_MODIFIED, CTRL_MODIFIED, HELP_MODIFIED, or SHIFT_MODIFIED

Examples:

The following returns the unique keyword for the DOWN key.

UNIQUE$KEY := KEY_NAME (DOWN);

The following defines the key press for uppercase Y in the default key-map to insert the text, "You pressed Y" in the current buffer.

DEFINE_KEY ( 'COPY_TEXT ("You pressed Y")', KEY_NAME ('Y'), 'Y key', );

Errors:

TPU$_BADKEY Only SHIFT_KEY, FUNCTION, or KEYPAD valid keynames.

TPU$_INCKWDCOM Bad keyword combination.

TPU$_MUSTBEONE String can only be a single character.

TPU$_NOTDEFINABLE Undefined key.

Related Builtins:

DEFINE_KEY

LOOKUP_KEY