Touch Keyboard Overview

From RAD Studio
Jump to: navigation, search

Go Up to VCL

The touch keyboard is a virtual keyboard component that can be used from Touch, Pen, or Mouse. The keyboard simulates a traditional computer keyboard for input and supports the most commonly used keyboard layouts, as well as number pad, for specific application requirements.

The touch keyboard has usability features specific to both touch and multi-touch systems. For example, the key sequence Ctrl + C can be performed using multi-touch. Similarly, holding down the Shift key while typing keys applies the Shift modifier. Because the users' fingers cover keys as they are pressed, the key messages are sent only when the keys are released. This allows users to change their mind and slide their fingers to other keys.

Adding a Touch Keyboard to Your Design

Under the Tool Palette search field, select TTouchKeyboard in the Touch category. The keyboard has a few properties that you can adjust in the Object Inspector, such as color gradient, key caption overrides (described below), cursor, and so on. See Vcl.Touch.Keyboard for more details about touch keyboard properties.

Selecting a Locale for the Keyboard

The keyboard uses the active input locale being used by the OS. However, you can programmatically change the locale by using the ActivateKeyboardLayout Windows API function. See the documentation for your operating system on how to install and change input languages.

Overriding Key Assignments

You can override the default key assignments to display different key labels for particular keys. For example, you might want to assign "Bksp" for the Backspace key instead of the default arrow label. Not all keys can be overridden. This is possible only for a subset of the keys on the keyboard. Click the KeyCaptions property in the Object Inspector, select a key that you want to override, and type the new label in the Value field.

See Also