Keyboard

Description

Supported Script Types:

  • Interface Scripts
  • Client Entity Scripts
  • Avatar Scripts
The Keyboard API provides facilities to use an in-world, virtual keyboard. When enabled, this keyboard is displayed instead of the 2D keyboard that raises at the bottom of the tablet or Web entities when a text input field has focus and you're in HMD mode.

Properties

Name Type Summary
raised boolean

true if the virtual keyboard is visible, false if it isn't.

password boolean

true if "*"s are displayed on the virtual keyboard's display instead of the characters typed, false if the actual characters are displayed.

use3DKeyboard boolean

true if user settings have "Use Virtual Keyboard" enabled, false if it's disabled. Read-only.

preferMalletsOverLasers boolean

true if user settings for the virtual keyboard have "Mallets" selected, false if "Lasers" is selected. Read-only.

Methods

Name Return Value Summary
containsID boolean

Checks whether an entity is part of the virtual keyboard.

disableLeftMallet None

Disables the left mallet so that it is not displayed when in HMD mode.

disableRightMallet None

Disables the right mallet so that it is not displayed when in HMD mode.

enableLeftMallet None

Enables the left mallet so that it is displayed when in HMD mode.

enableRightMallet None

Enables the right mallet so that it is displayed when in HMD mode.

loadKeyboardFile None

Loads a JSON file that defines the virtual keyboard's layout. The default JSON file used is https://github.com/highfidelity/hifi/.../keyboard.json.

setLeftHandLaser None

Configures the virtual keyboard to recognize a ray pointer as the left hand's laser.

setRightHandLaser None

Configures the virtual keyboard to recognize a ray pointer as the right hand's laser.

Method Details

(static) containsID( entityID ) → {boolean}
Returns: true if the entity is part of the virtual keyboard, false if it isn't.

Checks whether an entity is part of the virtual keyboard.

Parameters

Name Type Description
entityID Uuid

The entity ID.

(static) disableLeftMallet( )

Disables the left mallet so that it is not displayed when in HMD mode.

(static) disableRightMallet( )

Disables the right mallet so that it is not displayed when in HMD mode.

(static) enableLeftMallet( )

Enables the left mallet so that it is displayed when in HMD mode.

(static) enableRightMallet( )

Enables the right mallet so that it is displayed when in HMD mode.

(static) loadKeyboardFile( path )

Loads a JSON file that defines the virtual keyboard's layout. The default JSON file used is https://github.com/highfidelity/hifi/.../keyboard.json.

Parameters

Name Type Description
path string

The keyboard JSON file.

(static) setLeftHandLaser( leftHandLaser )

Configures the virtual keyboard to recognize a ray pointer as the left hand's laser.

Parameters

Name Type Description
leftHandLaser number

The ID of a ray pointer created by Pointers.createPointer.

(static) setRightHandLaser( rightHandLaser )

Configures the virtual keyboard to recognize a ray pointer as the right hand's laser.

Parameters

Name Type Description
rightHandLaser number

The ID of a ray pointer created by Pointers.createPointer.