Keyboard Shift States

In Windows, the shift state of a key is ignored unless explicitly specified. For example:

ID_MYACCELTABLE ACCELERATORS
  BEGIN
    "a", ID_LOWERA, ASCII
    "B", ID_UPPERB, ASCII SHIFT
  END

This accelerator table generates a WM_COMMAND of ID_LOWERA when the user clicks on the "a" key or "Shift+a" keys (with Caps Lock ON). However, a WM_COMMAND of ID_UPPERB will be generated only when you click on the "Shift+b" keys (with Caps Lock OFF).

In OS/2, the shift state of a key must be specified explicitly: The equivalent OS/2 accelerator table would look like:

ACCELTABLE ID_MYACCELTABLE
  BEGIN
    "a", ID_LOWERA, CHAR
    "a", ID_LOWERA, CHAR SHIFT /* Additional entry to allow SHIFT+a */
    "B", ID_UPPERB, CHAR SHIFT
  END

For Open32, the OS/2 model is followed; accelerator table entries that do not specify SHIFT will not generate WM_COMMAND messages when the user clicks on the Shift key.


[Back: System Accelerator Table]
[Next: Class Names]