Interface vrinputs

vr inputs

Type vrinputs

vrinputs.controllers

List of controllers and their corresponding interaction paths

vrinputs.getActiveActionBindings(Key)

Get the list of currently active bindings for the given action.

vrinputs.getActiveTriggerBindings(Key)

Get the list of currently active bindings for the given trigger.

vrinputs.getInputValue(path)

Gets the current value of an interaction path

vrinputs.getInteractionName(Path)

Translate an interaction path into a human readable name.

vrinputs.getInteractionProfileOfController(name)

Get the name of the currently active profile for the given controller

vrinputs.isKBMouseMode()

Check if the game is currently in keyboard+mouse mode, or using motion controllers.

vrinputs.setOutputValue(path, intensity)

Sets the haptic value of an output for this frame

vrinputs.version

Interface version

Type Controller

Controller.LEFT_HAND

'/user/hand/left'

Controller.RIGHT_HAND

'/user/hand/right'

Type vrinputs

Field(s)

#table vrinputs.controllers

List of controllers and their corresponding interaction paths

vrinputs.getActiveActionBindings(Key)

Get the list of currently active bindings for the given action.

Note that this returns full interaction paths.

Parameter

  • #string Key : The action key

Return value

list<#string> List of all active bindings. Will be an empty list if there are no bindings.

vrinputs.getActiveTriggerBindings(Key)

Get the list of currently active bindings for the given trigger.

Note that this returns full interaction paths.

Parameter

  • #string Key : The trigger key

Return value

list<#string> List of all active bindings. Will be an empty list if there are no bindings.

vrinputs.getInputValue(path)

Gets the current value of an interaction path

Parameter

  • #string path :

Return value

#any: Returns either a number or a boolean depending on the INTERACTION_VALUE_TYPE corresponding to this action, if the action is active. If the action is inactive (i.e. if none of the active controller have this path), returns nil. If the provided path is not a valid or known interaction, throws an error.

vrinputs.getInteractionName(Path)

Translate an interaction path into a human readable name.

Only english is currently supported.

Parameter

  • #string Path : The interaction path

Return value

#string: The interaction name

vrinputs.getInteractionProfileOfController(name)

Get the name of the currently active profile for the given controller

Parameter

  • #ReferenceSpace name : The interaction path of the controller (one of the top level input paths )

Return value

#Controller: The interaction profile name (one of '/user/hand/left' or '/user/hand/right')

vrinputs.isKBMouseMode()

Check if the game is currently in keyboard+mouse mode, or using motion controllers.

Return value

#boolean: True if the game is currently in keyboard+mouse mode, false if the game is currently in motion controllers mode.

vrinputs.setOutputValue(path, intensity)

Sets the haptic value of an output for this frame

Parameters

  • #string path :

  • #number intensity : Haptic intensity between 0 and 1

#number vrinputs.version

Interface version

Type Controller

Controller interaction paths

Field(s)

#string Controller.LEFT_HAND

'/user/hand/left'

#string Controller.RIGHT_HAND

'/user/hand/right'

Type ReferenceSpace