You can assign keystrokes to macros used within your Help file. These accelerator keys provide keyboard equivalents to macros displayed on menus or the button bar. To define an accelerator key, use the following macro:
AddAccelerator(key, shift_state, "macro")
The key parameter specifies the numeric code for the key, and shift_state specifies the required state of the CTRL, ALT, and SHIFT keys. For information on these numeric codes, see Appendix A, “Windows Virtual-Key Codes.”
For example, you can define CTRL+C to be the Clock key. When the user presses CTRL+C, your Help file displays the Windows Clock. The following macro assigns CTRL+C as the accelerator key for the ExecProgram macro:
AddAccelerator(0x43, 2, "ExecProgram(`clock.exe', 0)")
To remove an accelerator key that you have assigned to a macro, use the RemoveAccelerator macro. To remove an accelerator key, use the following macro:
Remove Accelerator(key, shift_state)
The following macro removes CTRL+C as the accelerator key for the ExecProgram macro:
RemoveAccelerator(0x43, 2)
For more information about assigning accelerator keys, see Chapter 15, “Help Macro reference.”.