Table of Contents

Class XRKeyboardManager

Wrapper class for Meta's Virtual Keyboard.

public class XRKeyboardManager : Singleton<XRKeyboardManager>
Inheritance
System.Object
XRKeyboardManager

Fields

InitialDistance

The initial distance of the keyboard, when shown, from the player's forward direction.

public float InitialDistance

Field Value

float

InitialPosition

The initial position of the keyboard, when shown, relative to the player.

public Vector3 InitialPosition

Field Value

Vector3

InitialRotation

The initial rotation of the keyboard, relative to the player's forward direction.

public Vector3 InitialRotation

Field Value

Vector3

KeyboardInstance

The current instance of the OVRVirtualKeyboard.

public OVRVirtualKeyboard KeyboardInstance

Field Value

OVRVirtualKeyboard

KeyboardPrefab

OVRVirtualKeyboard prefab to spawn when needed.

public OVRVirtualKeyboard KeyboardPrefab

Field Value

OVRVirtualKeyboard

LeftControllerDirectTransform

The "direct" transform of the left controller, for example: OVRCameraRig > OVRInteraction > OVRControllers > LeftController > ControllerInteractors > ControllerPokeInteractor > PokeLocation.

public Transform LeftControllerDirectTransform

Field Value

Transform

Remarks

You can add a tracked custom interactor to use as the direct transform:

  • Add a new GameObject with a ControllerRef, ControllerPointerPose and ActiveStateTracker under OVRInteraction > OVRControllers > LeftController > ControllerInteractors.
  • Drag LeftController into the ControllerRef's "Controller" field.
  • Set the "Active State" and "Controller" fields in the ActiveStateTracker and ControllerPointerPose to the ControllerRef.
  • Set the Z value in the "Offset" field of the ControllerPointerPose to 0.01.
  • (Optional) Enable "Include Children As Dependents" in the ActiveStateTracker and add a sphere as a child of the GameObject.

LeftControllerRootTransform

The root transform of the left controller, for example: OVRCameraRig > OVRInteraction > OVRControllers > LeftController.

public Transform LeftControllerRootTransform

Field Value

Transform

LeftOVRHand

The OVRHand script for left hand input.

public OVRHand LeftOVRHand

Field Value

OVRHand

NormalHandMaterial

The hand tracking material when the keyboard is not being used.

public Material NormalHandMaterial

Field Value

Material

OnKeyboardHidden

Called when the keyboard is destroyed.

public UnityEvent OnKeyboardHidden

Field Value

UnityEvent

OnKeyboardShown

Called when the keyboard is created.

public UnityEvent OnKeyboardShown

Field Value

UnityEvent

PlayerHead

The player Transform. The keyboard will spawn relative to this object's position. Defaults to first OVRCameraRig found in the scene.

public Transform PlayerHead

Field Value

Transform

RightControllerDirectTransform

The "direct" transform of the right controller, for example: OVRCameraRig > OVRInteraction > OVRControllers > RightController > ControllerInteractors > ControllerPokeInteractor > PokeLocation.

public Transform RightControllerDirectTransform

Field Value

Transform

Remarks

You can add a tracked custom interactor to use as the direct transform:

  • Add a new GameObject with a ControllerRef, ControllerPointerPose and ActiveStateTracker under OVRInteraction > OVRControllers > RightController > ControllerInteractors.
  • Drag RightController into the ControllerRef's "Controller" field.
  • Set the "Active State" and "Controller" fields in the ActiveStateTracker and ControllerPointerPose to the ControllerRef.
  • Set the Z value in the "Offset" field of the ControllerPointerPose to 0.01.
  • (Optional) Enable "Include Children As Dependents" in the ActiveStateTracker and add a sphere as a child of the GameObject.

RightControllerRootTransform

The root transform of the right controller, for example: OVRCameraRig > OVRInteraction > OVRControllers > RightController.

public Transform RightControllerRootTransform

Field Value

Transform

RightOVRHand

The OVRHand script for right hand input.

public OVRHand RightOVRHand

Field Value

OVRHand

TypingHandMaterial

The hand tracking material when the keyboard is being used.

public Material TypingHandMaterial

Field Value

Material

UseDifferentMaterialsForHandsWhenTyping

Should the hand tracking material be changed depending on if the keyboard is being used?

public bool UseDifferentMaterialsForHandsWhenTyping

Field Value

bool

Properties

CurrentListener

The object currently bound to the keyboard.

public OVRVirtualKeyboard.ITextHandler CurrentListener { get; }

Property Value

ITextHandler

Methods

RemoveListener(ITextHandler)

Unbinds the given object from the keyboard.

public void RemoveListener(OVRVirtualKeyboard.ITextHandler listener)

Parameters

listener ITextHandler

The object to unbind from the keyboard. Must be the same as CurrentListener.

SetListener(ITextHandler)

Binds the given object to the keyboard.

public void SetListener(OVRVirtualKeyboard.ITextHandler listener)

Parameters

listener ITextHandler

The object to bind to the keyboard.

Start()

protected void Start()