48.1.3 Accelerator Keystroke Assignments

When defining an accelerator, you must decide whether to use an ASCII character code or a virtual-key code for the accelerator. You should use an ASCII character code if you want the accelerator to be case sensitive. For example, if you want ALT+C to generate the accelerator but not ALT+C, you should use the ASCII “C” character to define the accelerator. Keep in mind, however, that case-sensitive accelerators can be confusing to use. For example, the ALT+C accelerator will be generated if the CAPS LOCK key is down or the SHIFT key is down, but not if both are down.

Typically, accelerators don't need to be case sensitive, so most applications use virtual-key codes for accelerators rather than ASCII character codes. For a list of virtual-key codes, see Appendix A, “Virtual-Key Codes.”

You should be careful not to define accelerators that conflict with your application's menu mnemonics. If you do, the accelerator overrides the mnemonic—this can confuse the user. For more information about menu mnemonics, see Chapter 47, “Menus.”

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. You should avoid doing this because it prevents the system accelerator from performing its standard role in the Windows user interface. The system-wide accelerators are described in the following list:

Accelerator Description

ALT+ESC Switches to the next application.
ALT+F4 Quits an application or closes a window.
ALT+HYPHEN Opens the System menu for a document window.
ALT+PRINT SCREEN Copies an image of the active window onto the Clipboard.
ALT+SPACEBAR Opens the System menu for an application window.
ALT+TAB Switches to the next application.
CTRL+ESC Switches to Task List.
CTRL+F4 Closes the active group window or document window.
F1 Starts Help if the application has Help.
PRINT SCREEN Copies an image of the screen onto the Clipboard.
SHIFT+ALT+TAB Switches to the previous application. The user must press and hold down ALT+SHIFT while pressing TAB.