Displaying command key sequences

The virtual keyboard classes provide a mechanism for creating a text string to represent the key sequence a user must type to invoke a command. These text strings are commonly used in menus and other user interface items.

Users typically expect to see this command key sequence correspond to the current physical keyboard rather than the current virtual keyboard. For example, an end user who is using the virtual keyboard for symbol characters would still expect to see the correct physical keys listed as menu item equivalents. Therefore, the command key sequence Command-Z appears rather than the command key sequence Command-z, the symbol produced by the Z key on the symbol keyboard.

The TStandardEditableVirtualKeyboard class allows you to specify a second virtual keyboard to be used for command mapping for any particular keyboard. For example, for the Symbol character keyboard, you might select the standard U.S. QWERTY keyboard to use for mapping commands. Use the SetVirtualKeyboardForCommand member function to specify the command keyboard, identifying the keyboard by its localizable name.

Each command keyboard can have an associated modifier key that, applied to the virtual keyboard, represents the appearance of the physical keyboard. For example, the key caps on the standard U.S. QWERTY keyboard typically represent the results of applying the Caps Lock modifier to each virtual key. The keyboard uses these results to create the command key sequence. Use the SetCommandKeyModifiers member function to set this field.

Menus and other interface elements that need to display command key sequences call the TVirtualKeyboardHandle function CommandText. This function returns a text string for the command key sequence based on the command keyboard and associated modifier key. Optionally, you can specify characters to represent modifier keys in the text string, using the SetModifierAppearance member function.



[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker