Macro control codes enable the use of non-printing keys, such as Enter or the arrow keys, in macro definitions.
The plus sign (+), caret (^), percent sign (%), tilde (~), and parentheses ( ) have special meanings in macro definitions. To specify one of these characters, enclose it with braces. For example, to specify the plus sign, use {+}. Brackets {[ ]} have no special meaning but must also be quoted because of the routines that are used to implement macros.
To specify brace characters, use {{} and {}}.
To specify characters that are not displayed when you press a key, such as Enter or Tab, and action keys use the codes displayed in Table 18.
Table 18. Macro Control Codes
Key | Code |
---|---|
Backspace | {BACKSPACE}, {BS}, or {BKSP} |
DEL or Delete | {DELETE} or {DEL} |
Down arrow | {DOWN} |
End | {END} |
Enter | {ENTER} or ~ |
Home | {HOME} |
INS or Insert | {INSERT} or {INS} |
Left arrow | {LEFT} |
Right arrow | {RIGHT} |
Tab | {TAB} |
Up arrow | {UP} |
To specify keys used in combination with the Shift, Ctrl, and Alt keys, precede the key code with one or more of the codes in Table 19.
To specify a combination of Shift, Ctrl, and Alt to be held down while several other keys are pressed, enclose the code for those keys in parentheses. For example, to specify that the user must hold down Shift while E and C are pressed, use "+(EC)". To specify that the user must hold down Shift while E is pressed, followed by C without Shift, use "+EC".
To specify repeating keys, use the form {key number}, and insert a space between key and number. For example, {LEFT 42} means press the left arrow key 42 times; {h 10} means press h, 10 times.