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 = VK_F5, KeyF6 = VK_F6, KeyF7 = VK_F7, KeyF8 = VK_F8, KeyF9 = VK_F9, KeyF10 = VK_F10, KeyF11 = VK_F11, KeyF12 = VK_F12, KeyInsert = VK_INSERT, KeyDelete = VK_DELETE, KeyBackspace...