Keyboard Accelerators

A keyboard accelerator, also known as a shortcut key, is a keystroke, or combination of keystrokes, that generates a WM_COMMAND message. Keyboard accelerators are often used as shortcuts for commonly used menu commands, but you can also use them to generate commands that have no equivalent menu items. Include keyboard accelerators for any common or frequent actions, and provide support for the common shortcut keys wherever they apply.

You can use an ASCII character code or a virtual-key code to define the accelerator. An ASCII character code makes the accelerator case sensitive. The ASCII "C" character can define the accelerator as alt+c rather than alt+c. Because accelerators do not need to be case sensitive, most applications use virtual-key codes for accelerators rather than ASCII character codes.

If an application defines an accelerator that is also defined in the system accelerator table, the application-defined accelerator overrides the system accelerator, but only within the context of the application. Avoid this practice, however, because it prevents the system accelerator from performing its standard role in the Windows user interface. For general guidelines on assigning shortcut keys, see Designing the User Interface for Windows CE.