API reference

OVRVirtualKeyboard Class

Extends MonoBehaviour
Enables Virtual Keyboard integration.

Member Enumerations

Enumeration KeyboardPosition

The initial position of the keyboard, which determines the input style used to type.
Far uses raycasting to type. Near uses direct touch to type. If set to Far or Near, the keyboard position is runtime controlled, so the Transform component will be locked.
Far
= 0
Near
= 1
Direct
= 1
Custom
= 2

Enumeration InputSource

ControllerLeft
No description available
ControllerRight
No description available
HandLeft
No description available
HandRight
No description available

Events

Action< string > CommitText
Occurs when text has been committed @params (string text)
Action Backspace
Occurs when a backspace is pressed.
Action Enter
Occurs when a return key is pressed.
Action KeyboardShown
Occurs when keyboard is shown.
Action KeyboardHidden
Occurs when keyboard is hidden.

Properties

Collider Collider[Get]
InputField TextCommitField[Get]
ITextHandler TextHandler[Get]

Fields

Transform leftControllerRootTransform[Get]
Configure with the transform representing the left controller input.
Transform leftControllerDirectTransform[Get]
Transform rightControllerRootTransform[Get]
Configure with the transform representing the right controller input.
Transform rightControllerDirectTransform[Get]
bool controllerDirectInteraction[Get]
Enables the controllers to directly interact with the keyboard.
bool controllerRayInteraction[Get]
Enables the controllers to send ray interactions to the keyboard.
OVRPhysicsRaycaster controllerRaycaster[Get]
Configures the raycast mask used when sending raycast controller input to the keyboard.
OVRHand handLeft[Get]
The OVRHand representing the left hand.
Requires the OVRHand to also have an OVRSkeleton.
OVRHand handRight[Get]
The OVRHand representing the right hand.
Requires the OVRHand to also have an OVRSkeleton.
bool handDirectInteraction[Get]
Enables tracked hands to directly interact with the keyboard.
bool handRayInteraction[Get]
Enables tracked hands to send ray interactions to the keyboard.
OVRPhysicsRaycaster handRaycaster[Get]
Configures the raycast mask used when sending raycast hand input to the keyboard.
Shader keyboardModelShader[Get]
The shader used to render the keyboard’s glTF materials.
Shader keyboardModelAlphaBlendShader[Get]
The shader used to render the keyboard’s glTF alpha blended materials.
bool InputEnabled[Get]
If false, prevents all keyboard input.
CommitTextUnityEvent CommitTextEvent[Get]
UnityEvent BackspaceEvent[Get]
UnityEvent EnterEvent[Get]
UnityEvent KeyboardShownEvent[Get]
UnityEvent KeyboardHiddenEvent[Get]

Member Functions

void UseSuggestedLocation
( KeyboardPosition position )
Updates the keyboard to a reference position.
void SendVirtualKeyboardRayInput
( Transform inputTransform,
InputSource source,
bool isPressed,
bool useRaycastMask )
Sends a ray input to the keyboard from a given transform.
Parameters
inputTransform
GameObject Transform with the pose and forward orientation of the input ray.
source
Input source to use (ex. Controller/Hand Left/Right).
isPressed
If true, will trigger a key press if the ray collides with a keyboard key.
useRaycastMask
Defaults to true. Will use the configured raycast mask for the given input source.
void SendVirtualKeyboardDirectInput
( Vector3 position,
InputSource source,
bool isPressed,
Transform interactorRootTransform )
Sends a direct input to the keyboard from a given transform.
Parameters
position
The collision point which is interacting with the keyboard. For example, a hand index finger tip.
source
The input source to use (ex. Controller/Hand Left/Right).
isPressed
If the input is triggering a press or not.
void ChangeTextContext
( string textContext )
Enables custom handling of text context.
Use this when changing input fields or if the input text has changed via another script.
void AutoPopulate ( )