By default, the hotkey associated with a menu item is its first letter or number. Hotkeys must be either a letter or a number.
Sometimes, you may wish to assign a different hotkey to the menu item. This can come about if you have more than one option beginning with the same letter, or if you want to display the instruction:
"Press ESC to close the menu",
but do not want it to be selected when letter "p" is pressed.
You will also need to explicitly define the hotkey if you want one to select the default item as well as pressing ENTER.
To define a hotkey, put an ampersand sign ("&") followed by the letter or number that you intend to use before the start of the displayable menu text. For example, to assign letter "c" to the item:
"Escape: Close menu",
type:
"&cEscape: Close menu".
Enter an illegal character for the hotkey if you do not want a hotkey assigned to the item at all, in which case, it would have to be either the default item or the Escape item, or it would not be selectable. For example:
"& Escape: Close menu".
With the above, only Escape can be used to close the menu without selection.
The ampersand sign and the hotkey are not included in the text displayed for the item. If you wish to indicate the hotkey on screen, you must include indicative characters explicitly in the ensuing display text.
The ampersand sign must come after the '*' that defines an item as the default selection, if used, which must itself follow any new line suppression, blank line generation or leading white space characters.
If you need to display an ampersand sign at the beginning of the line as part of informational text, put 3 ampersands after the initial colon:
":&&&This is an information line with an illegal hotkey".
The colon is actually unnecessary in the above example, since th first ampersand sign defines the second ampersand sign as the hotkey, which is not acknowledged. You need to use this strategy to display an initial ampersand because the use of the initial colon does not suppress ampersand processing.
Page url: http://wtcmanual.wintextware.com/index.html?wtri_assigning_menu_hotkeys.htm