Accelerator-Item Styles

An accelerator item has a style that determines what combination of keys produces the accelerator and what command message is generated by the accelerator. An application can specify the following accelerator-item styles in the fs field of the ACCEL structure:

┌───────────────┬─────────────────────────────────────────────┐
│Style          │Description                                  │
├───────────────┼─────────────────────────────────────────────┤
│AF_ALT         │Specifies that the user must hold down the   │
│               │Alt key while pressing the accelerator key.  │
├───────────────┼─────────────────────────────────────────────┤
│AF_CHAR        │Specifies that the keystroke is a character  │
│               │that is translated using the code page for   │
│               │the accelerator table. (This is the default  │
│               │style.)                                      │
├───────────────┼─────────────────────────────────────────────┤
│AF_CONTROL     │Specifies that the user must hold down the   │
│               │Ctrl key while pressing the accelerator key. │
├───────────────┼─────────────────────────────────────────────┤
│AF_HELP        │Specifies that the accelerator generates a   │
│               │WM_HELP message instead of a WM_COMMAND      │
│               │message.                                     │
├───────────────┼─────────────────────────────────────────────┤
│AF_LONEKEY     │Specifies that the user need not press       │
│               │another key while the accelerator key is     │
│               │down.  Typically, this style is used with the│
│               │Alt key to specify that simply pressing and  │
│               │releasing that key triggers the accelerator. │
├───────────────┼─────────────────────────────────────────────┤
│AF_SCANCODE    │Specifies that the keystroke is an           │
│               │untranslated scan code from the keyboard.    │
├───────────────┼─────────────────────────────────────────────┤
│AF_SHIFT       │Specifies that the user must hold down the   │
│               │Shift key when pressing the accelerator key. │
├───────────────┼─────────────────────────────────────────────┤
│AF_SYSCOMMAND  │Specifies that the accelerator generates a   │
│               │WM_SYSCOMMAND message instead of a WM_COMMAND│
│               │message.                                     │
├───────────────┼─────────────────────────────────────────────┤
│AF_VIRTUALKEY  │Specifies that the keystroke is a virtual    │
│               │key-for example, the F1 function key.        │
└───────────────┴─────────────────────────────────────────────┘


[Back: Accelerator-Table Data Structures]
[Next: Using Keyboard Accelerators]