Each virtual keyboard maintains a set of mapping rules between a virtual key code, or a combination of modifier keys and a virtual key code, and either a single Unicode character or multiple Unicode characters. You create these mappings independently of the layout of the physical keyboard. These virtual keyboards are nonmodal. To provide dead-key functionality, use the transliteration classes.
The following classes provide the mechanism for creating and modifying
virtual keyboards:
TVirtualKeyboard is the abstract base class providing the protocol for virtual keyboards, including:
TStandardEditableVirtualKeyboard provides the concrete implementation of TVirtualKeyboard, including functions for accessing and editing the keyboard mapping rules. This class is responsible for managing the storage of keyboard mapping rules.
TVirtualKeyboardHandle provides a lightweight mechanism for accessing a specific virtual keyboard. Because a TStandardEditableVirtualKeyboard encapsulates a very large amount of data, you should reference a virtual keyboard with a handle unless you need to edit the keyboard data.
NOTE
In a future release, the Typing framework will provide an editor for viewing, modifying, and creating virtual keyboards. This editor will use the interfaces described in this section. In the meantime, use the classes described here to create and modify virtual keyboards programmatically through text file representations.
The keyboard classes also include an exception class, TVirtualKeyboardException. This class, derived from TStandardException, defines the following exception conditions:
Each keyboard can also have localizable names for use with the locale mechanism. Exception handling
Exception | Description | |
kNoVirtualKeyboards | No keyboards are installed. | |
kKeyboardNotInstalled | The specified keyboard is not installed. | |
kDefaultKeyboardNotInstalled | A default global keyboard has not been installed. | |
kKeyboardInstantiationFailed | The data for the keyboard could not be streamed in. |