Virtual Keyboard Sample Project
The
Mobile OpenXR SDK includes a complete example of how you can integrate Virtual Keyboard using the
SampleXrFramework provided by the SDK. The sample project is under
\XrSamples\XrVirtualKeyboard\.
The sample project showcases different features of Virtual Keyboard including:
- Hands and Controllers interaction
- Near and Far field input (via raycast and touch)
- Keyboard positioning and scaling (via analog stick)
- Swipe typing and typeahead suggestions
- Touch limiting for improved feedback
Here is an overview of the contents of the sample:
The main entry point of the sample application. It contains the full definition of XrVirtualKeyboardApp
, which derives from OVRFW::XrApp
and implements all the app lifecycle methods. It also controls and manages the sample UI.
XrVirtualKeyboardHelper.h/cpp Helper class for accessing the XR_META_virtual_keyboard
extension API. It holds the handles to a Virtual Keyboard instance and the corresponding XrSpace
.
XrRenderModelHelper.h/cpp Helper class for accessing the XR_FB_render_model
extension API. It manages the render model properties and provides functions to query the render model key and data.
Helper class for accessing the hand tracking extensions. It provides functionalities to using hands as input and manages the hand render model.
VirtualKeyboardModelRenderer.h/cpp Helper class for rendering the Virtual Keyboard model. It keeps references to the dynamic textures and the loaded glTF model so we can apply the texture and animation updates returned by the runtime.