Develop
Develop
Select your platform

Track Keyboards in MR Utility Kit

Updated: Aug 26, 2025

Overview

The keyboard tracker can identify and track a physical keyboard in the environment.
In MRUK, keyboards are a type of trackable. Read more about trackables in the Mixed Reality Utility Kit - Trackables overview.

Prerequisites

  • Quest 3 / 3s or later.
  • Horizon OS v72 or later.
  • Unity 2022.3.15f1 or later.
  • Meta XR Core SDK v72 or later.
  • Meta MR Utility Kit v72 or later.
  • (optional) Link PC app v72 or later.

Enable Keyboard Tracking in MRUK

To enable Keyboard Tracking in MRUK:
  1. Enable Spatial Data Permission on your Meta Quest.
  2. Use Building Blocks to Create the Camera Rig.
  3. Use Building Blocks to Create a Passthrough Layer.
  4. Keyboard tracking requires Scene and Anchor features to be enabled.
    1. Click on Camera Rig > OVR Manager > General > Scene Support and select Required.
    2. Click on Camera Rig > OVR Manager > General > Anchor Support and select Enabled.
  5. To enable keyboard tracking in MRUK, add an MRUK component to a GameObject in your scene. Then, expand the Scene Settings > Tracker Configuration foldouts and check the Keyboard Tracking Enabled box.

Representation in Unity

Keyboards are a type of trackable (MRUKTrackable). Keyboards have the following properties:
  • A 6 degree-of-freedom pose (position and rotation) represented by a UnityEngine.Transform.
  • A 2D bounding box, accessible from MRUKAnchor.PlaneRect.
  • A 2D polygon, accessible from MRUKAnchor.PlaneBoundary2D.
  • A 3D bounding box, accessible from MRUKAnchor.VolumeBounds.

Trackable Events

When a new trackable is detected, MRUK creates a new GameObject and invokes the TrackableAdded event. Use the MRUKTrackable.TrackableType property to determine what type of trackable was detected.
public void OnTrackableAdded(MRUKTrackable trackable)
{
    if (trackable.TrackableType == OVRAnchor.TrackableType.Keyboard)
    {
        Instantiate(keyboardPrefab, trackable.transform);
    }
}
MRUK will continue to update the transform of the GameObject it created as it tracks the keyboard. If the keyboard is lost, MRUK will invoke the TrackableRemoved event.
Keyboard Tracking Sample
Keyboard Tracker Sample
Demonstrates how to build a keyboard tracker using MRUKTrackables and trackable events. Includes the Bounded3DVisualizer that fits prefabs, such as a Passthrough Overlay, to a detected keyboard’s 3D bounds.
View sample
Tracked Keyboard text input sample
Tracked Keyboard text input sample
This sample showcases the tracked keyboard feature, providing a comprehensive panel for text input. In addition, the panel offers 2D and 3D visualization options for the keyboard. It also includes toggles for desk and passthrough modes, as well as tracking status. With these features, this sample provides a solid foundation for building mixed reality applications with tracked keyboards.
View sample

Previous:Trackables overview
Did you find this page helpful?