AddAccelerator (or AA)

Assigns an accelerator (keyboard access) key or key combination to a Help macro so that the user can execute the macro simply by pressing the accelerator key(s).

Syntax

AddAccelerator(key, shift-state, "macro")

AA(key, shift-state, "macro")

Parameter Description

key Windows virtual-key value of the accelerator key the user must press to execute the macro. For the list of virtual keys, see Appendix A, “Windows Virtual-Key Codes.”
shift-state Number specifying the key or key combination to use with the accelerator key. Valid modifier keys are ALT, SHIFT, and CTRL.

NumberModifier key(s)

0(No modifier key)

1SHIFT

2CTRL

3SHIFT+CTRL

4ALT

5ALT+SHIFT

6ALT+CTRL

7ALT+SHIFT+CTRL

macro Help macro or macro string that executes when the user presses the accelerator key(s). The macro must be enclosed in quotation marks. Separate multiple macros in a string with semicolons (;).

Example

The following macro assigns a key combination to the JumpID macro so that the user can display an alphabetic index of Help topics by pressing ALT+CTRL+F10:

AddAccelerator(0x79, 6, "JumpID(`index.hlp', `cont_idx')")

Comments

The Help macro that AddAccelerator executes might not work in secondary windows, or its use may not be recommended if the macro it executes is prohibited or not recommended in secondary windows. Check the macro’s “Comments” section before using AddAccelerator to execute it in a secondary window.

See Also

RemoveAccelerator