Macro Language Reference > Macros > Keyboard > *
  
*
Description
Assigns one or more macros to a key or key combination.
 
Example 162. Assign a macro to a key combination
The macro below assigns a sequence of macros that 'fake' a titling font to the AT key combination:
*1020 tot .0065h:tw .96h:toc white:tlsb -.01w
 
Example 163. Assign macros and actions to a key combination using variable values
The macros assigned to a key can be as simple or as complicated as you like, although they should not be longer than 255 characters. Although you cannot include script conditions on a key assignment, var macros can be used, allowing you to produce key assignments such as the one shown below. This uses getvar to get the number of pages currently shown on-screen by tpagexy, then programs the R key to move down the document by that number of pages:
*1081 (wdb "Ac","Dn"):(tpagexy):(^Ac*^Dn):(tpgoto+<^Ac^)
 
Example 164. Redefine the F1 key assignment using getvar values
Several similar uses of variables are used in the key assignments built into startdos.3ad. The VF1 assignment even includes a redefinition of F1 itself, so that the user can press VF1 to mark the current location in the text and later on press F1 to go back to that point:
*1094 getvar 11520 "StrmA":getvar 21522 "PosA":(*1059 (ttop
"^StrmA" ^PosA):(ttrack)^)
Syntax
* char code:n macro string:b
char code
The PTC ALD key code of the key or key combination to be used. For most keys this is automatically inserted by PTC ALD if you type the key combination after the *. For the letter keys and some other keys on the keyboard you must insert the key's ASCII value yourself. When you try to program one of these keys its numeric code will not be automatically inserted, e.g. if you try to program the A key you should enter:
*A *65
macro string
Any macro, or sequence of macros, that you wish to be executed when the key or key combination defined by char code is used.
Additional Information
The * macro can also be used to program macros from a menu: open the menu and highlight the required option, then press the * key to assign that option to a key combination. You will be prompted for the key combination.
* 
In conjunction with the wmnx macro you can assign PTC ALD or user defined menus to the right mouse button.
Related Links