The typing configuration accesses its virtual keyboard through an instance of TVirtualKeyboardHandle. It maps keyboard input to text using the handle's MapKeyToText member function. This function takes:
It uses the mapping rules of the current keyboard to determine the result. For example, this call maps the virtual S key and Shift key event into the appropriate text (TLatin::kCapitalLetterS for English keyboards), returning it in the text instance provided:
TStandardText textResult; TModifierKeys modifiers; modifiers.SetShiftKey(); keyboardHandle.MapKeyToText(TVirtualKeyCode::kC02, modifiers, textResult);
You can get the handle of the current keyboard from the typing configuration using the TTypingConfigurationHandle::GetKeyboard member function. You can also use the TVirtualKeyboardHandle::SetCurrentKeyboard member function to access any available keyboard, using a localizable name to identify the keyboard you want. TVirtualKeyboard throws the TVirtualKeyboardException condition kKeyboardNotInstalled if you specify a nonexistent keyboard.