To conclude our discussion of menus in KOL, we need to supplement information on accelerators (keyboard shortcuts) that are used to invoke menu items from the keyboard. These keyboard shortcuts are automatically displayed to the right of the text in the menu when the Accelerator or ItemAccelerator [i] property is used to assign them. In fact, their text is simply added to the text of the menu through the tabulator character (and the system already provides the alignment of such additional columns after the tabulation character # 9). Note: if you want to place a non-standard text designation of the accelerator to the right of the menu text in this position, or list several keyboard shortcuts that cause the same action, you just need to change the menu text yourself using this menu feature.
Accelerator, i.e. a keyboard shortcut can be generated by calling the global function MakeAccelerator (Virt, Key), where Virt is a combination of the FSHIFT, FCONTROL, FALT, FVIRTKEY, FNOINVERT flags, and Key is a character or virtual key code.
You can get some "standard" text corresponding to the accelerator using the GetAcceleratorText (acc) function. In fact, this function forms the text itself using the GetKeyNameText API function. If the resulting text does not suit you, you can use your own.