Telerik XR CanvasUI provides a keyboard prefab that allows you to show a virtual keyboard when the XR user selects an input field.
The keyboard prefab is installed through simple dragging and dropping into the scene hierarchy. By default, its UI children are hidden, however, when the user clicks on an input field, the
Keyboard component automatically repositions the prefab below the input field and shows the keyboard UI. The following input fields are currently supported:
The keyboard is hidden when:
EventSystem.current.currentSelectedGameObjectis not of the
You can hide the keyboard either programmatically or by clicking on another UI element (for instance, on a Dropdown).
All of the keyboard keys are created by using the
Key prefab. This prefab is drawing the key text by using TextMeshPro. It also has an attached
Key component. The
Key component is responsible for handling the pointer events and for providing the KeyCode and character code information for the corresponding key.
Each of the keys implements
IPointerUpHandler interfaces for handling Unity pointer events. Additionally, the
Keyboard prefab has a
TouchSurfaceCanvas component to allow close distance finger interactions when using hand tracking.
The pointers logic is not included in the Telerik XR CanvasUI package. However, in the Telerik XR Interactions package, you may find easy-to-setup pointers for both distant interactions and close-distance finger interactions. This package may be purchased from the Unity Asset Store either standalone or as part of the Telerik XR Complete solution.
To customize the layout of the keyboard:
Key Codeproperty values of the
Characterproperty values of the