The Accelerator class

It is possible to add an accelerator to a menu item. The accelerator text is preceded by a tabulator character (\t) and the text is made up of the optional prefixes Ctrl+, Shift+, or Alt+ followed by a character (for instance, &Open\tCtrl+O) or the name of a virtual key (for instance, &Save\tAlt+F2).

Accelerator.h

namespace SmallWindows { 

The Win32 API holds a set of virtual keys with names beginning with VK_. In Small Windows, they have been given other names, hopefully easier to understand. The virtual keys available are: F1 - F12, Insert, Delete, Backspace, Tab, Home, End, Page Up, Page Down, Left, Right, Up, Down, Space, Escape, and Return:

 enum Keys {KeyF1 = VK_F1, KeyF2 = VK_F2, KeyF3 = VK_F3, KeyF4 = VK_F4, KeyF5 = ...

Get C++ Windows Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.