Functions:
-Properties
--
-
- - getActions - -
- - getHardware - -
- - getStandard - -
Mappings
--
-
- - disableMapping - -
- - enableMapping - -
- - loadMapping - -
- - newMapping - -
- - parseMapping - -
Input, Hardware, and Action Reflection
--
-
- - findAction - -
- - findDevice - -
- - getActionNames - -
- - getAllActions - -
- - getAvailableInputs - -
- - getDeviceName - -
- - getDeviceNames - -
Input, Hardware, and Action Events
--
-
- - actionEvent - -
- - hardwareChanged - -
- - inputEvent - -
Mouse, Keyboard, and Touch Events
--
-
- - keyPressEvent - -
- - keyReleaseEvent - -
- - mouseDoublePressEvent - -
- - mouseMoveEvent - -
- - mousePressEvent - -
- - mouseReleaseEvent - -
- - touchBeginEvent - -
- - touchEndEvent - -
- - touchUpdateEvent - -
- - wheelEvent - -
Control Capturing
--
-
- - captureMouseEvents - -
- - captureTouchEvents - -
- - captureWheelEvents - -
- - releaseMouseEvents - -
- - releaseTouchEvents - -
- - releaseWheelEvents - -
Action Capturing
--
-
- - captureActionEvents - -
- - captureEntityClickEvents - -
- - captureJoystick - -
- - captureKeyEvents - -
- - releaseActionEvents - -
- - releaseEntityClickEvents - -
- - releaseJoystick - -
- - releaseKeyEvents - -
Controller and Action Values
--
-
- - getValue - -
- - getAxisValue - -
- - getgetPoseValue - -
- - getButtonValue for a particular device -
- - getAxisValue for a particular device -
- - getPoseValue for a particular device -
- - getActionValue - -
Haptics
--
-
- - triggerHapticPulse - -
- - triggerHapticPulseOnDevice - -
- - triggerShortHapticPulse - -
- - triggerShortHapticPulseOnDevice - -
Display Information
--
-
- - getViewportDimensions - -
- - getRecommendedHUDRect - -
Virtual Game Pad
--
-
- - setVPadEnabled - -
- - setVPadHidden - -
- - setVPadExtraBottomMargin - -
Input Recordings
--
-
- - startInputRecording - -
- - stopInputRecording - -
- - saveInputRecording - -
- - getInputRecorderSaveDirectory - -
- - loadInputRecording - -
- - startInputPlayback - -
- - stopInputPlayback - -
Available in: | -Interface Scripts | -Client Entity Scripts | -
---|
Properties
-Name | -Type | -Description | -
---|---|---|
Actions |
- Controller.Actions | -Predefined actions on Interface and the user's avatar. These can be used as end points in a
- RouteObject mapping. A synonym for Controller.Hardware.Actions . Read-only.
- Default mappings are provided from the Controller.Hardware.Keyboard and Controller.Standard to actions in
- keyboardMouse.json and
- standard.json, respectively. |
-
Hardware |
- Controller.Hardware | -Standard and hardware-specific controller and computer outputs, plus predefined actions on Interface and the user's avatar. The outputs can be mapped to Actions or functions in a
- RouteObject mapping. Additionally, hardware-specific controller outputs can be mapped to Standard controller outputs. Read-only. |
-
Standard |
- Controller.Standard | -Standard controller outputs that can be mapped to Actions or functions in a
- RouteObject mapping. Read-only.
- Each hardware device has a mapping from its outputs to Controller.Standard items, specified in a JSON file. For example,
- leapmotion.json and
- vive.json. |
-
Methods
-actionEvent(actionID, value) → {Signal}
-Parameters:
-Name | -Type | -Description | -
---|---|---|
actionID |
- number | -The ID of the action, per - findAction. | -
value |
- number | -The value associated with the action. | -
Returns:
--
-
- Type: Signal
Example
-Report action events as they occur.
var actionNamesForID = {};
-var actionNames = Controller.getActionNames();
-for (var i = 0, length = actionNames.length; i < length; i++) {
- actionNamesForID[Controller.findAction(actionNames[i])] = actionNames[i];
-}
-
-function onActionEvent(action, value) {
- print("onActionEvent() : " + action + " ( " + actionNamesForID[action] + " ) ; " + value);
-}
-
-Controller.actionEvent.connect(onActionEvent);
-
-Script.scriptEnding.connect(function () {
- Controller.actionEvent.disconnect(onActionEvent);
-});
- captureActionEvents()
-Example
-Disable avatar translation and rotation for a short period.
Script.setTimeout(function () {
- Controller.captureActionEvents();
-}, 5000);
-
-Script.setTimeout(function () {
- Controller.releaseActionEvents();
-}, 10000);
- captureEntityClickEvents()
-Example
-Disable entity click events for a short period.
Entities.mousePressOnEntity.connect(function (entityID, event) {
- print("Clicked on entity: " + entityID);
-});
-
-Script.setTimeout(function () {
- Controller.captureEntityClickEvents();
-}, 5000);
-
-Script.setTimeout(function () {
- Controller.releaseEntityClickEvents();
-}, 10000);
- captureJoystick(joystickID)
-Parameters:
-Name | -Type | -Description | -
---|---|---|
joystickID |
- number | -The integer ID of the joystick. | -
-
-
- Deprecated: -
-
-
-
-
- This function no longer has any effect. -
-
captureKeyEvents(event)
-Parameters:
-Name | -Type | -Description | -
---|---|---|
event |
- KeyEvent | -Details of the key event to be captured. The key property must be specified. The text property is ignored. The other properties default to false . |
-
Example
-Disable left and right strafing.
var STRAFE_LEFT = { "key": 16777234, isShifted: true };
-var STRAFE_RIGHT = { "key": 16777236, isShifted: true };
-
-Controller.captureKeyEvents(STRAFE_LEFT);
-Controller.captureKeyEvents(STRAFE_RIGHT);
-
-Script.scriptEnding.connect(function () {
- Controller.releaseKeyEvents(STRAFE_LEFT);
- Controller.releaseKeyEvents(STRAFE_RIGHT);
-});
- captureMouseEvents()
-Example
-Disable Controller.Hardware.Keyboard mouse events for a short period.
var MAPPING_NAME = "com.highfidelity.controllers.example.newMapping";
-var mapping = Controller.newMapping(MAPPING_NAME);
-mapping.from(Controller.Hardware.Keyboard.MouseX).to(function (x) {
- print("Mouse x = " + x);
-});
-mapping.from(Controller.Hardware.Keyboard.MouseY).to(function (y) {
- print("Mouse y = " + y);
-});
-Controller.enableMapping(MAPPING_NAME);
-Script.scriptEnding.connect(function () {
- Controller.disableMapping(MAPPING_NAME);
-});
-
-Script.setTimeout(function () {
- Controller.captureMouseEvents();
-}, 5000);
-
-Script.setTimeout(function () {
- Controller.releaseMouseEvents();
-}, 10000);
- captureTouchEvents()
-captureWheelEvents()
-disableMapping(mappingName)
-Parameters:
-Name | -Type | -Description | -
---|---|---|
mappingName |
- string | -The name of the mapping. | -
enableMapping(mappingName, enable)
-Parameters:
-Name | -Type | -Default | -Description | -
---|---|---|---|
mappingName |
- string | -- | The name of the mapping. | -
enable |
- boolean | -true | -If true then the mapping is enabled, otherwise it is disabled. |
-
findAction(actionName) → {number}
-Parameters:
-Name | -Type | -Description | -
---|---|---|
actionName |
- string | -The name of the action: one of the - Controller.Actions property names. | -
Returns:
-4095
. Note that this value is not the same as the value of the relevant
- Controller.Actions property.-
-
- Type: number
Example
-Get the ID of the "TranslateY" action. Compare with the property value.
var actionID = Controller.findAction("TranslateY");
-print("Action ID = " + actionID); // 1
-print("Property value = " + Controller.Actions.TranslateY); // 537001728 or similar value.
- findDevice(deviceName) → {number}
-Parameters:
-Name | -Type | -Description | -
---|---|---|
deviceName |
- string | -The name of the device to find. | -
Returns:
-65535
.-
-
- Type: number
Example
-Get the ID of the Oculus Touch.
var deviceID = Controller.findDevice("OculusTouch");
-print("Device ID = " + deviceID);
- getActionNames() → {Array.<string>}
-Returns:
--
-
- Type: Array.<string>
Example
-Get the names of all actions.
var actionNames = Controller.getActionNames();
-print("Action names: " + JSON.stringify(actionNames));
-// ["TranslateX","TranslateY","TranslateZ","Roll", ...
- getActions() → {Controller.Actions}
-Controller.Actions
.Returns:
--
-
- Type: Controller.Actions
getActionValue(actionID) → {number}
-Parameters:
-Name | -Type | -Description | -
---|---|---|
actionID |
- number | -The integer ID of the action. | -
Returns:
--
-
- Type: number
Example
-Periodically report the value of the "TranslateX" action.
var actionID = Controller.findAction("TranslateX");
-
-function reportValue() {
- print(Controller.getActionValue(actionID));
-}
-reportTimer = Script.setInterval(reportValue, 1000);
- getAllActions() → {Array.<Action>}
--
-
- Deprecated: -
-
-
-
-
- This function no longer works. -
-
Returns:
--
-
- Type: Array.<Action>
getAvailableInputs(deviceID) → {Array.<NamedPair>}
-Parameters:
-Name | -Type | -Description | -
---|---|---|
deviceID |
- number | -Integer ID of the hardware device. | -
-
-
- Deprecated: -
-
-
-
-
- This function no longer works. -
-
Returns:
--
-
- Type: Array.<NamedPair>
getAxisValue(source) → {number}
-Parameters:
-Name | -Type | -Description | -
---|---|---|
source |
- number | -The - Controller.Standard or - Controller.Hardware item. | -
Returns:
-source
is valid, otherwise 0
.-
-
- Type: number
getAxisValue(source, deviceopt) → {number}
-Parameters:
-Name | -Type | -Attributes | -Default | -Description | -
---|---|---|---|---|
source |
- StandardAxisChannel | -- | - | The axis to get the value of. | -
device |
- number | - <optional>
- - |
- 0 | -The ID of the hardware device to get the value from. The default value of 0 corresponds to Standard . |
-
-
-
- Deprecated: -
-
-
-
-
- This function no longer works. -
-
Returns:
-0
.-
-
- Type: number
getButtonValue(source, deviceopt) → {number}
-Parameters:
-Name | -Type | -Attributes | -Default | -Description | -
---|---|---|---|---|
source |
- StandardButtonChannel | -- | - | The button to get the value of. | -
device |
- number | - <optional>
- - |
- 0 | -The ID of the hardware device to get the value from. The default value of 0 corresponds to Standard . |
-
-
-
- Deprecated: -
-
-
-
-
- This function no longer works. -
-
Returns:
-0
.-
-
- Type: number
getDeviceName(deviceID) → {string}
-Parameters:
-Name | -Type | -Description | -
---|---|---|
deviceID |
- number | -The integer ID of the device. | -
Returns:
-"unknown"
.-
-
- Type: string
Example
-Get the name of the Oculus Touch controller from its ID.
var deviceID = Controller.findDevice("OculusTouch");
-print("Device ID = " + deviceID);
-
-var deviceName = Controller.getDeviceName(deviceID);
-print("Device name = " + deviceName);
- getDeviceNames() → {Array.<string>}
-Returns:
--
-
- Type: Array.<string>
Example
-Get the names of all currently available controller devices.
var deviceNames = Controller.getDeviceNames();
-print(JSON.stringify(deviceNames));
-// ["Standard","Keyboard","LeapMotion","OculusTouch","Application","Actions"] or similar.
- getHardware() → {Controller.Hardware}
-Controller.Hardware
.Returns:
--
-
- Type: Controller.Hardware
getInputRecorderSaveDirectory() → {string}
-Returns:
--
-
- Type: string
getPoseValue(source) → {Pose}
-Parameters:
-Name | -Type | -Description | -
---|---|---|
source |
- number | -The - Controller.Standard or - Controller.Hardware pose output. | -
Returns:
-source
is a pose output, otherwise an invalid pose with Pose.valid == false
.-
-
- Type: Pose
getPoseValue(source, deviceopt) → {Pose}
-Parameters:
-Name | -Type | -Attributes | -Default | -Description | -
---|---|---|---|---|
source |
- StandardPoseChannel | -- | - | The pose to get the value of. | -
device |
- number | - <optional>
- - |
- 0 | -The ID of the hardware device to get the value from. The default value of 0 corresponds to Standard . |
-
-
-
- Deprecated: -
-
-
-
-
- This function no longer works. -
-
Returns:
-Pose.valid == false
.-
-
- Type: Pose
getRecommendedHUDRect() → {Rect}
-Returns:
--
-
- Type: Rect
getStandard() → {Controller.Standard}
-Controller.Standard
.Returns:
--
-
- Type: Controller.Standard
getValue(source) → {number}
-Parameters:
-Name | -Type | -Description | -
---|---|---|
source |
- number | -The - Controller.Standard or - Controller.Hardware item. | -
Returns:
-source
is valid, otherwise 0
.-
-
- Type: number
Example
-Report the Standard and Vive right trigger values.
var triggerValue = Controller.getValue(Controller.Standard.RT);
-print("Trigger value: " + triggerValue);
-
-if (Controller.Hardware.Vive) {
- triggerValue = Controller.getValue(Controller.Hardware.Vive.RT);
- print("Vive trigger value: " + triggerValue);
-} else {
- print("No Vive present");
-}
- getViewportDimensions() → {Vec2}
-Returns:
--
-
- Type: Vec2
hardwareChanged() → {Signal}
-hardwareChanged
events: for example connecting or disconnecting a mouse will not generate an event but connecting or disconnecting an Xbox
- controller will.Returns:
--
-
- Type: Signal
inputEvent(action, value) → {Signal}
-Parameters:
-Name | -Type | -Description | -
---|---|---|
action |
- number | -The input action, per - Controller.Standard. | -
value |
- number | -The value associated with the input action. | -
Returns:
--
-
- Type: Signal
Example
-Report input events as they occur.
var inputNamesForID = {};
-for (var property in Controller.Standard) {
- inputNamesForID[Controller.Standard[property]] = "Controller.Standard." + property;
-}
-
-function onInputEvent(input, value) {
- print("onInputEvent() : " + input + " ( " + inputNamesForID[input] + " ) ; " + value);
-}
-
-Controller.inputEvent.connect(onInputEvent);
-
-Script.scriptEnding.connect(function () {
- Controller.inputEvent.disconnect(onInputEvent);
-});
- keyPressEvent(event) → {Signal}
-Parameters:
-Name | -Type | -Description | -
---|---|---|
event |
- KeyEvent | -Details of the key press. | -
Returns:
--
-
- Type: Signal
Example
-Report the KeyEvent details for each key press.
Controller.keyPressEvent.connect(function (event) {
- print(JSON.stringify(event));
-});
- keyReleaseEvent(event) → {Signal}
-Parameters:
-Name | -Type | -Description | -
---|---|---|
event |
- KeyEvent | -Details of the key release. | -
Returns:
--
-
- Type: Signal
loadInputRecording(file)
-Parameters:
-Name | -Type | -Description | -
---|---|---|
file |
- string | -The path to the recording file, prefixed by "file:///" . |
-
loadMapping(jsonURL) → {MappingObject}
-Parameters:
-Name | -Type | -Description | -
---|---|---|
jsonURL |
- string | -The URL the - MappingJSON JSON file. | -
-
-
- To Do: -
-
-
-
-
- Implement this function. It currently does not load the mapping from the file; it just returns
null
.
-
- - Implement this function. It currently does not load the mapping from the file; it just returns
Returns:
--
-
- Type: MappingObject
mouseDoublePressEvent(event) → {Signal}
-Parameters:
-Name | -Type | -Description | -
---|---|---|
event |
- MouseEvent | -Details of the button double-press. | -
Returns:
--
-
- Type: Signal
mouseMoveEvent(event) → {Signal}
-Parameters:
-Name | -Type | -Description | -
---|---|---|
event |
- MouseEvent | -Details of the mouse movement. | -
Returns:
--
-
- Type: Signal
Example
-Report the MouseEvent details for each mouse move.
Controller.mouseMoveEvent.connect(function (event) {
- print(JSON.stringify(event));
-});
- mousePressEvent(event) → {Signal}
-Parameters:
-Name | -Type | -Description | -
---|---|---|
event |
- MouseEvent | -Details of the button press. | -
Returns:
--
-
- Type: Signal
mouseReleaseEvent(event) → {Signal}
-Parameters:
-Name | -Type | -Description | -
---|---|---|
event |
- MouseEvent | -Details of the button release. | -
Returns:
--
-
- Type: Signal
newMapping(mappingName) → {MappingObject}
-Standard
controls, Actions
, or script functions using
- RouteObject methods. The mapping can then be enabled using
- enableMapping for it to take effect.Parameters:
-Name | -Type | -Default | -Description | -
---|---|---|---|
mappingName |
- string | -Uuid.generate() | -A unique name for the mapping. If not specified a new UUID generated by - Uuid.generate is used. | -
Returns:
--
-
- Type: MappingObject
Example
-Create a simple mapping that makes the right trigger move your avatar up.
var MAPPING_NAME = "com.highfidelity.controllers.example.newMapping";
-var mapping = Controller.newMapping(MAPPING_NAME);
-
-mapping.from(Controller.Standard.RT).to(Controller.Actions.TranslateY);
-Controller.enableMapping(MAPPING_NAME);
-
-Script.scriptEnding.connect(function () {
- Controller.disableMapping(MAPPING_NAME);
-});
- parseMapping(jsonString) → {MappingObject}
-Parameters:
-Name | -Type | -Description | -
---|---|---|
jsonString |
- string | -A JSON string of the - MappingJSON. | -
Returns:
--
-
- Type: MappingObject
Example
-Create a simple mapping that makes the right trigger move your avatar up.
var mappingJSON = {
- "name": "com.highfidelity.controllers.example.jsonMapping",
- "channels": [
- { "from": "Standard.RT", "to": "Actions.TranslateY" }
- ]
-};
-
-var mapping = Controller.parseMapping(JSON.stringify(mappingJSON));
-mapping.enable();
-
-Script.scriptEnding.connect(function () {
- mapping.disable();
-});
- releaseActionEvents()
-releaseEntityClickEvents()
-releaseJoystick(joystickID)
-Parameters:
-Name | -Type | -Description | -
---|---|---|
joystickID |
- number | -The integer ID of the joystick. | -
-
-
- Deprecated: -
-
-
-
-
- This function no longer has any effect. -
-
releaseKeyEvents(event)
-Parameters:
-Name | -Type | -Description | -
---|---|---|
event |
- KeyEvent | -Details of the key event to release from capture. The key property must be specified. The text property is ignored. The other properties default to false . |
-
releaseMouseEvents()
-releaseTouchEvents()
-releaseWheelEvents()
-saveInputRecording()
-setVPadEnabled(enable)
-Parameters:
-Name | -Type | -Description | -
---|---|---|
enable |
- boolean | -If true then the virtual game pad doesn't work, otherwise it does work provided that it is not hidden by
- setVPadHidden. |
-
setVPadExtraBottomMargin(margin)
-Parameters:
-Name | -Type | -Description | -
---|---|---|
margin |
- number | -Integer number of pixels in the extra margin. | -
setVPadHidden(hidden)
-Parameters:
-Name | -Type | -Description | -
---|---|---|
hidden |
- boolean | -If true then the virtual game pad is hidden, otherwise it is shown. |
-
startInputPlayback()
-Example
-Play back a controller recording.
var file = Window.browse("Select Recording", Controller.getInputRecorderSaveDirectory());
-if (file !== null) {
- print("Play recording: " + file);
- Controller.loadInputRecording("file:///" + file);
- Controller.startInputPlayback();
-
- // Stop playback after 20s.
- Script.setTimeout(function () {
- print("Stop playing recording");
- Controller.stopInputPlayback();
- }, 20000);
-}
- startInputRecording()
-Example
-Make a controller recording.
// Delay start of recording for 2s.
-Script.setTimeout(function () {
- print("Start input recording");
- Controller.startInputRecording();
-}, 2000);
-
-// Make a 10s recording.
-Script.setTimeout(function () {
- print("Stop input recording");
- Controller.stopInputRecording();
- Controller.saveInputRecording();
- print("Input recording saved in: " + Controller.getInputRecorderSaveDirectory());
-}, 12000);
- stopInputPlayback()
-stopInputRecording()
-touchBeginEvent(event) → {Signal}
-Parameters:
-Name | -Type | -Description | -
---|---|---|
event |
- TouchEvent | -Details of the touch begin. | -
Returns:
--
-
- Type: Signal
Example
-Report the TouchEvent details when a touch event starts.
Controller.touchBeginEvent.connect(function (event) {
- print(JSON.stringify(event));
-});
- touchEndEvent(event) → {Signal}
-Parameters:
-Name | -Type | -Description | -
---|---|---|
event |
- TouchEvent | -Details of the touch end. | -
Returns:
--
-
- Type: Signal
touchUpdateEvent(event) → {Signal}
-Parameters:
-Name | -Type | -Description | -
---|---|---|
event |
- TouchEvent | -Details of the touch update. | -
Returns:
--
-
- Type: Signal
triggerHapticPulse(strength, duration, hand)
-Parameters:
-Name | -Type | -Default | -Description | -
---|---|---|---|
strength |
- number | -- | The strength of the haptic pulse, 0.0 – 1.0 . |
-
duration |
- number | -- | The duration of the haptic pulse, in milliseconds. | -
hand |
- Controller.Hand | -2 | -The hand or hands to trigger the haptic pulse on. | -
Example
-Trigger a haptic pulse on the right hand.
var HAPTIC_STRENGTH = 0.5;
-var HAPTIC_DURATION = 10;
-var RIGHT_HAND = 1;
-Controller.triggerHapticPulse(HAPTIC_STRENGTH, HAPTIC_DURATION, RIGHT_HAND);
- triggerHapticPulseOnDevice(deviceID, strength, duration, hand)
-Parameters:
-Name | -Type | -Default | -Description | -
---|---|---|---|
deviceID |
- number | -- | The ID of the device to trigger the haptic pulse on. | -
strength |
- number | -- | The strength of the haptic pulse, 0.0 – 1.0 . |
-
duration |
- number | -- | The duration of the haptic pulse, in milliseconds. | -
hand |
- Controller.Hand | -2 | -The hand or hands to trigger the haptic pulse on. | -
Example
-Trigger a haptic pulse on an Oculus Touch controller.
var HAPTIC_STRENGTH = 0.5;
-var deviceID = Controller.findDevice("OculusTouch");
-var HAPTIC_DURATION = 10;
-var RIGHT_HAND = 1;
-Controller.triggerHapticPulseOnDevice(deviceID, HAPTIC_STRENGTH, HAPTIC_DURATION, RIGHT_HAND);
- triggerShortHapticPulse(strength, hand)
-Parameters:
-Name | -Type | -Default | -Description | -
---|---|---|---|
strength |
- number | -- | The strength of the haptic pulse, 0.0 – 1.0 . |
-
hand |
- Controller.Hand | -2 | -The hand or hands to trigger the haptic pulse on. | -
triggerShortHapticPulseOnDevice(deviceID, strength, hand)
-Parameters:
-Name | -Type | -Default | -Description | -
---|---|---|---|
deviceID |
- number | -- | The ID of the device to trigger the haptic pulse on. | -
strength |
- number | -- | The strength of the haptic pulse, 0.0 – 1.0 . |
-
hand |
- Controller.Hand | -2 | -The hand or hands to trigger the haptic pulse on. | -
wheelEvent(event) → {Signal}
-Parameters:
-Name | -Type | -Description | -
---|---|---|
event |
- WheelEvent | -Details of the wheel movement. | -
Returns:
--
-
- Type: Signal
Example
-Report the WheelEvent details for each wheel rotation.
Controller.wheelEvent.connect(function (event) {
- print(JSON.stringify(event));
-});
-
- Type Definitions
-Actions
-The Controller.Actions
object has properties representing predefined actions on the user's avatar and Interface. The property values are integer IDs, uniquely identifying each action. Read-only. These can be used as end
- points in the routes of a
- MappingObject. The data routed to each action is either a number or a
- Pose.
Property | -Type | -Data | -Description | -
---|---|---|---|
Avatar Movement | -|||
TranslateX |
- number | -number | -Move the user's avatar in the direction of its x-axis, if the camera isn't in independent or mirror modes. | -
TranslateY |
- number | -number | -Move the user's avatar in the direction of its y-axis, if the camera isn't in independent or mirror modes. | -
TranslateZ |
- number | -number | -Move the user's avatar in the direction of its z-axis, if the camera isn't in independent or mirror modes. | -
Pitch |
- number | -number | -Rotate the user's avatar head and attached camera about its negative x-axis (i.e., positive values pitch down), if the camera isn't in HMD, independent, or mirror modes. | -
Yaw |
- number | -number | -Rotate the user's avatar about its y-axis, if the camera isn't in independent or mirror modes. | -
Roll |
- number | -number | -No action. | -
StepTranslateX |
- number | -number | -No action. | -
StepTranslateY |
- number | -number | -No action. | -
StepTranslateZ |
- number | -number | -No action. | -
StepPitch |
- number | -number | -No action. | -
StepYaw |
- number | -number | -Rotate the user's avatar about its y-axis in a step increment, if the camera isn't in independent or mirror modes. | -
StepRoll |
- number | -number | -No action. | -
Avatar Skeleton | -|||
Hips |
- number | -- Pose - | -Set the hips pose of the user's avatar. | -
Spine2 |
- number | -- Pose - | -Set the spine2 pose of the user's avatar. | -
Head |
- number | -- Pose - | -Set the head pose of the user's avatar. | -
LeftArm |
- number | -- Pose - | -Set the left arm pose of the user's avatar. | -
RightArm |
- number | -- Pose - | -Set the right arm pose of the user's avatar. | -
LeftHand |
- number | -- Pose - | -Set the left hand pose of the user's avatar. | -
LeftHandThumb1 |
- number | -- Pose - | -Set the left thumb 1 finger joint pose of the user's avatar. | -
LeftHandThumb2 |
- number | -- Pose - | -Set the left thumb 2 finger joint pose of the user's avatar. | -
LeftHandThumb3 |
- number | -- Pose - | -Set the left thumb 3 finger joint pose of the user's avatar. | -
LeftHandThumb4 |
- number | -- Pose - | -Set the left thumb 4 finger joint pose of the user's avatar. | -
LeftHandIndex1 |
- number | -- Pose - | -Set the left index 1 finger joint pose of the user's avatar. | -
LeftHandIndex2 |
- number | -- Pose - | -Set the left index 2 finger joint pose of the user's avatar. | -
LeftHandIndex3 |
- number | -- Pose - | -Set the left index 3 finger joint pose of the user's avatar. | -
LeftHandIndex4 |
- number | -- Pose - | -Set the left index 4 finger joint pose of the user's avatar. | -
LeftHandMiddle1 |
- number | -- Pose - | -Set the left middle 1 finger joint pose of the user's avatar. | -
LeftHandMiddle2 |
- number | -- Pose - | -Set the left middle 2 finger joint pose of the user's avatar. | -
LeftHandMiddle3 |
- number | -- Pose - | -Set the left middle 3 finger joint pose of the user's avatar. | -
LeftHandMiddle4 |
- number | -- Pose - | -Set the left middle 4 finger joint pose of the user's avatar. | -
LeftHandRing1 |
- number | -- Pose - | -Set the left ring 1 finger joint pose of the user's avatar. | -
LeftHandRing2 |
- number | -- Pose - | -Set the left ring 2 finger joint pose of the user's avatar. | -
LeftHandRing3 |
- number | -- Pose - | -Set the left ring 3 finger joint pose of the user's avatar. | -
LeftHandRing4 |
- number | -- Pose - | -Set the left ring 4 finger joint pose of the user's avatar. | -
LeftHandPinky1 |
- number | -- Pose - | -Set the left pinky 1 finger joint pose of the user's avatar. | -
LeftHandPinky2 |
- number | -- Pose - | -Set the left pinky 2 finger joint pose of the user's avatar. | -
LeftHandPinky3 |
- number | -- Pose - | -Set the left pinky 3 finger joint pose of the user's avatar. | -
LeftHandPinky4 |
- number | -- Pose - | -Set the left pinky 4 finger joint pose of the user's avatar. | -
RightHand |
- number | -- Pose - | -Set the right hand of the user's avatar. | -
RightHandThumb1 |
- number | -- Pose - | -Set the right thumb 1 finger joint pose of the user's avatar. | -
RightHandThumb2 |
- number | -- Pose - | -Set the right thumb 2 finger joint pose of the user's avatar. | -
RightHandThumb3 |
- number | -- Pose - | -Set the right thumb 3 finger joint pose of the user's avatar. | -
RightHandThumb4 |
- number | -- Pose - | -Set the right thumb 4 finger joint pose of the user's avatar. | -
RightHandIndex1 |
- number | -- Pose - | -Set the right index 1 finger joint pose of the user's avatar. | -
RightHandIndex2 |
- number | -- Pose - | -Set the right index 2 finger joint pose of the user's avatar. | -
RightHandIndex3 |
- number | -- Pose - | -Set the right index 3 finger joint pose of the user's avatar. | -
RightHandIndex4 |
- number | -- Pose - | -Set the right index 4 finger joint pose of the user's avatar. | -
RightHandMiddle1 |
- number | -- Pose - | -Set the right middle 1 finger joint pose of the user's avatar. | -
RightHandMiddle2 |
- number | -- Pose - | -Set the right middle 2 finger joint pose of the user's avatar. | -
RightHandMiddle3 |
- number | -- Pose - | -Set the right middle 3 finger joint pose of the user's avatar. | -
RightHandMiddle4 |
- number | -- Pose - | -Set the right middle 4 finger joint pose of the user's avatar. | -
RightHandRing1 |
- number | -- Pose - | -Set the right ring 1 finger joint pose of the user's avatar. | -
RightHandRing2 |
- number | -- Pose - | -Set the right ring 2 finger joint pose of the user's avatar. | -
RightHandRing3 |
- number | -- Pose - | -Set the right ring 3 finger joint pose of the user's avatar. | -
RightHandRing4 |
- number | -- Pose - | -Set the right ring 4 finger joint pose of the user's avatar. | -
RightHandPinky1 |
- number | -- Pose - | -Set the right pinky 1 finger joint pose of the user's avatar. | -
RightHandPinky2 |
- number | -- Pose - | -Set the right pinky 2 finger joint pose of the user's avatar. | -
RightHandPinky3 |
- number | -- Pose - | -Set the right pinky 3 finger joint pose of the user's avatar. | -
RightHandPinky4 |
- number | -- Pose - | -Set the right pinky 4 finger joint pose of the user's avatar. | -
LeftFoot |
- number | -- Pose - | -Set the left foot pose of the user's avatar. | -
RightFoot |
- number | -- Pose - | -Set the right foot pose of the user's avatar. | -
Application | -|||
BoomIn |
- number | -number | -Zoom camera in from third person toward first person view. | -
BoomOut |
- number | -number | -Zoom camera out from first person to third person view. | -
CycleCamera |
- number | -number | -Cycle the camera view from first person, to third person, to full screen mirror, then back to first person and repeat. | -
ContextMenu |
- number | -number | -Show / hide the tablet. | -
ToggleMute |
- number | -number | -Toggle the microphone mute. | -
ToggleOverlay |
- number | -number | -Toggle the display of overlays. | -
Sprint |
- number | -number | -Set avatar sprint mode. | -
ReticleClick |
- number | -number | -Set mouse-pressed. | -
ReticleX |
- number | -number | -Move the cursor left/right in the x direction. | -
ReticleY |
- number | -number | -move the cursor up/down in the y direction. | -
ReticleLeft |
- number | -number | -Move the cursor left. | -
ReticleRight |
- number | -number | -Move the cursor right. | -
ReticleUp |
- number | -number | -Move the cursor up. | -
ReticleDown |
- number | -number | -Move the cursor down. | -
UiNavLateral |
- number | -number | -Generate a keyboard left or right arrow key event. | -
UiNavVertical |
- number | -number | -Generate a keyboard up or down arrow key event. | -
UiNavGroup |
- number | -number | -Generate a keyboard tab or back-tab key event. | -
UiNavSelect |
- number | -number | -Generate a keyboard Enter key event. | -
UiNavBack |
- number | -number | -Generate a keyboard Esc key event. | -
LeftHandClick |
- number | -number | -Deprecated: No action. | -
RightHandClick |
- number | -number | -Deprecated: No action. | -
Shift |
- number | -number | -Deprecated: No action. | -
PrimaryAction |
- number | -number | -Deprecated: No action. | -
SecondaryAction |
- number | -number | -Deprecated: No action. | -
Aliases | -|||
Backward |
- number | -number | -Alias for TranslateZ in the positive direction. |
-
Forward |
- number | -number | -Alias for TranslateZ in the negative direction. |
-
StrafeRight |
- number | -number | -Alias for TranslateX in the positive direction. |
-
StrafeLeft |
- number | -number | -Alias for TranslateX in the negative direction. |
-
Up |
- number | -number | -Alias for TranslateY in the positive direction. |
-
Down |
- number | -number | -Alias for TranslateY in the negative direction. |
-
PitchDown |
- number | -number | -Alias for Pitch in the positive direction. |
-
PitchUp |
- number | -number | -Alias for Pitch in the negative direction. |
-
YawLeft |
- number | -number | -Alias for Yaw in the positive direction. |
-
YawRight |
- number | -number | -Alias for Yaw in the negative direction. |
-
Deprecated Aliases | -|||
LEFT_HAND |
- number | -- Pose - | -Deprecated: Use LeftHand instead. |
-
RIGHT_HAND |
- number | -- Pose - | -Deprecated: Use RightHand instead. |
-
BOOM_IN |
- number | -number | -Deprecated: Use BoomIn instead. |
-
BOOM_OUT |
- number | -number | -Deprecated: Use BoomOut instead. |
-
CONTEXT_MENU |
- number | -number | -Deprecated: Use ContextMenu instead. |
-
TOGGLE_MUTE |
- number | -number | -Deprecated: Use ToggleMute instead. |
-
SPRINT |
- number | -number | -Deprecated: Use Sprint instead. |
-
LONGITUDINAL_BACKWARD |
- number | -number | -Deprecated: Use Backward instead. |
-
LONGITUDINAL_FORWARD |
- number | -number | -Deprecated: Use Forward instead. |
-
LATERAL_LEFT |
- number | -number | -Deprecated: Use StrafeLeft instead. |
-
LATERAL_RIGHT |
- number | -number | -Deprecated: Use StrafeRight instead. |
-
VERTICAL_UP |
- number | -number | -Deprecated: Use Up instead. |
-
VERTICAL_DOWN |
- number | -number | -Deprecated: Use Down instead. |
-
PITCH_DOWN |
- number | -number | -Deprecated: Use PitchDown instead. |
-
PITCH_UP |
- number | -number | -Deprecated: Use PitchUp instead. |
-
YAW_LEFT |
- number | -number | -Deprecated: Use YawLeft instead. |
-
YAW_RIGHT |
- number | -number | -Deprecated: Use YawRight instead. |
-
LEFT_HAND_CLICK |
- number | -number | -Deprecated: Use LeftHandClick instead. |
-
RIGHT_HAND_CLICK |
- number | -number | -Deprecated: Use RightHandClick instead. |
-
SHIFT |
- number | -number | -Deprecated: Use Shift instead. |
-
ACTION1 |
- number | -number | -Deprecated: Use PrimaryAction instead. |
-
ACTION2 |
- number | -number | -Deprecated: Use SecondaryAction instead. |
-
Deprecated Trackers | -|||
TrackedObject00 |
- number | -- Pose - | -Deprecated: No action. | -
TrackedObject01 |
- number | -- Pose - | -Deprecated: No action. | -
TrackedObject02 |
- number | -- Pose - | -Deprecated: No action. | -
TrackedObject03 |
- number | -- Pose - | -Deprecated: No action. | -
TrackedObject04 |
- number | -- Pose - | -Deprecated: No action. | -
TrackedObject05 |
- number | -- Pose - | -Deprecated: No action. | -
TrackedObject06 |
- number | -- Pose - | -Deprecated: No action. | -
TrackedObject07 |
- number | -- Pose - | -Deprecated: No action. | -
TrackedObject08 |
- number | -- Pose - | -Deprecated: No action. | -
TrackedObject09 |
- number | -- Pose - | -Deprecated: No action. | -
TrackedObject10 |
- number | -- Pose - | -Deprecated: No action. | -
TrackedObject11 |
- number | -- Pose - | -Deprecated: No action. | -
TrackedObject12 |
- number | -- Pose - | -Deprecated: No action. | -
TrackedObject13 |
- number | -- Pose - | -Deprecated: No action. | -
TrackedObject14 |
- number | -- Pose - | -Deprecated: No action. | -
TrackedObject15 |
- number | -- Pose - | -Deprecated: No action. | -
Hand
-Some controller actions may be associated with one or both hands:
-Value | -Description | -
---|---|
0 |
- Left hand. | -
1 |
- Right hand. | -
2 |
- Both hands. | -
Type:
--
-
- number -
Hardware
-The Controller.Hardware
object has properties representing standard and hardware-specific controller and computer outputs, plus predefined actions on Interface and the user's avatar. Read-only. The outputs can be mapped
- to actions or functions in a
- RouteObject mapping. Additionally, hardware-specific controller outputs can be mapped to standard controller outputs.
-
Controllers typically implement a subset of the - Controller.Standard controls, plus they may implement some extras. Some common controllers are included in the table. You can see the outputs provided by these and others by viewing their - MappingJSON files at - https://github.com/highfidelity/hifi/tree/master/interface/resources/controllers.
-Property | -Type | -Description | -
---|---|---|
Controller.Hardware.Actions |
- object | -Synonym for - Controller.Actions. | -
Controller.Hardware.Application |
- object | -Interface state outputs. See - Controller.Hardware-Application. | -
Controller.Hardware.Keyboard |
- object | -Keyboard, mouse, and touch pad outputs. See - Controller.Hardware-Keyboard. | -
Controller.Hardware.OculusTouch |
- object | -Oculus Rift HMD outputs. See - Controller.Hardware-OculusTouch. | -
Controller.Hardware.Vive |
- object | -Vive HMD outputs. See - Controller.Hardware-Vive. | -
Example
-List all the currently available Controller.Hardware
properties.
function printProperties(string, item) {
- print(string);
- for (var key in item) {
- if (item.hasOwnProperty(key)) {
- printProperties(string + "." + key, item[key]);
- }
- }
-}
-
-printProperties("Controller.Hardware", Controller.Hardware);
-
- Hardware-Application
-The Controller.Hardware.Application
object has properties representing Interface's state. The property values are integer IDs, uniquely identifying each output. Read-only. These can be mapped to actions or functions or
- Controller.Standard
items in a
- RouteObject mapping (e.g., using the
- RouteObject#when method). Each data value is either 1.0
for "true" or 0.0
for "false".
Property | -Type | -Data | -Description | -
---|---|---|---|
CameraFirstPerson |
- number | -number | -The camera is in first-person mode. | -
CameraThirdPerson |
- number | -number | -The camera is in third-person mode. | -
CameraFSM |
- number | -number | -The camera is in full screen mirror mode. | -
CameraIndependent |
- number | -number | -The camera is in independent mode. | -
CameraEntity |
- number | -number | -The camera is in entity mode. | -
InHMD |
- number | -number | -The user is in HMD mode. | -
AdvancedMovement |
- number | -number | -Advanced movement controls are enabled. | -
SnapTurn |
- number | -number | -Snap turn is enabled. | -
Grounded |
- number | -number | -The user's avatar is on the ground. | -
NavigationFocused |
- number | -number | -Not used. | -
Hardware-Keyboard
-The Controller.Hardware.Keyboard
object has properties representing keyboard, mouse, and display touch events. The property values are integer IDs, uniquely identifying each output. Read-only. These can be mapped to actions
- or functions or Controller.Standard
items in a
- RouteObject mapping. For presses, each data value is either 1.0
for "true" or 0.0
for "false".
Property | -Type | -Data - | Description | -
---|---|---|---|
0 – 9 |
- number | -number | -A "0" – "1" key on the keyboard or keypad is pressed. | -
A – Z |
- number | -number | -A "A" – "Z" key on the keyboard is pressed. | -
Space |
- number | -number | -The space bar on the keyboard is pressed. | -
Tab |
- number | -number | -The tab key on the keyboard is pressed. | -
Shift |
- number | -number | -The shift key on the keyboard is pressed. | -
Control |
- number | -number | -The control key on the keyboard is pressed. (The "Command" key on OSX.) | -
Left |
- number | -number | -The left arrow key on the keyboard or keypad is pressed. | -
Right |
- number | -number | -The right arrow key on the keyboard or keypad is pressed. | -
Up |
- number | -number | -The up arrow key on the keyboard or keypad is pressed. | -
Down |
- number | -number | -The down arrow key on the keyboard or keypad is pressed. | -
PgUp |
- number | -number | -The page up key on the keyboard or keypad is pressed. | -
PgDown |
- number | -number | -The page down key on the keyboard or keypad is pressed. | -
LeftMouseButton |
- number | -number | -The left mouse button pressed. | -
MiddleMouseButton |
- number | -number | -The middle mouse button pressed. | -
RightMouseButton |
- number | -number | -The right mouse button pressed. | -
LeftMouseClicked |
- number | -number | -The left mouse button clicked. | -
MiddleMouseClicked |
- number | -number | -The middle mouse button clicked. | -
RightMouseClicked |
- number | -number | -The right mouse button clicked. | -
MouseMoveRight |
- number | -number | -The mouse moved right. | -
MouseMoveLeft |
- number | -number | -The mouse moved left. | -
MouseMoveUp |
- number | -number | -The mouse moved up. | -
MouseMoveDown |
- number | -number | -The mouse moved down. | -
MouseX |
- number | -number | -The mouse x-coordinate changed. The data value is its new x-coordinate value. | -
MouseY |
- number | -number | -The mouse y-coordinate changed. The data value is its new y-coordinate value. | -
MouseWheelRight |
- number | -number | -The mouse wheel rotated left. The data value is the number of units rotated (typically 1.0 ). |
-
MouseWheelLeft |
- number | -number | -The mouse wheel rotated left. The data value is the number of units rotated (typically 1.0 ). |
-
MouseWheelUp |
- number | -number | -The mouse wheel rotated up. The data value is the number of units rotated (typically 1.0 ). |
-
MouseWheelDown |
- number | -number | -The mouse wheel rotated down. The data value is the number of units rotated (typically 1.0 ). |
-
TouchpadRight |
- number | -number | -The average touch on a touch-enabled device moved right. The data value is how far the average position of all touch points moved. | -
TouchpadLeft |
- number | -number | -The average touch on a touch-enabled device moved left. The data value is how far the average position of all touch points moved. | -
TouchpadUp |
- number | -number | -The average touch on a touch-enabled device moved up. The data value is how far the average position of all touch points moved. | -
TouchpadDown |
- number | -number | -The average touch on a touch-enabled device moved down. The data value is how far the average position of all touch points moved. | -
-
-
- To Do: -
-
-
-
-
- Currently, the mouse wheel in an ordinary mouse generates left/right wheel events instead of up/down. -
-
Hardware-OculusTouch
-The Controller.Hardware.OculusTouch
object has properties representing Oculus Rift. The property values are integer IDs, uniquely identifying each output. Read-only. These can be mapped to actions or functions or Controller.Standard
items in a
- RouteObject mapping.
Property | -Type | -Data | -Description | -
---|---|---|---|
Buttons | -|||
A |
- number | -number | -"A" button pressed. | -
B |
- number | -number | -"B" button pressed. | -
X |
- number | -number | -"X" button pressed. | -
Y |
- number | -number | -"Y" button pressed. | -
LeftApplicationMenu |
- number | -number | -Left application menu button pressed. | -
RightApplicationMenu |
- number | -number | -Right application menu button pressed. | -
Sticks | -|||
LX |
- number | -number | -Left stick x-axis scale. | -
LY |
- number | -number | -Left stick y-axis scale. | -
RX |
- number | -number | -Right stick x-axis scale. | -
RY |
- number | -number | -Right stick y-axis scale. | -
LS |
- number | -number | -Left stick button pressed. | -
RS |
- number | -number | -Right stick button pressed. | -
LSTouch |
- number | -number | -Left stick is touched. | -
RSTouch |
- number | -number | -Right stick is touched. | -
Triggers | -|||
LT |
- number | -number | -Left trigger scale. | -
RT |
- number | -number | -Right trigger scale. | -
LeftGrip |
- number | -number | -Left grip scale. | -
RightGrip |
- number | -number | -Right grip scale. | -
Finger Abstractions | -|||
LeftPrimaryThumbTouch |
- number | -number | -Left thumb touching primary thumb button. | -
LeftSecondaryThumbTouch |
- number | -number | -Left thumb touching secondary thumb button. | -
LeftThumbUp |
- number | -number | -Left thumb not touching primary or secondary thumb buttons. | -
RightPrimaryThumbTouch |
- number | -number | -Right thumb touching primary thumb button. | -
RightSecondaryThumbTouch |
- number | -number | -Right thumb touching secondary thumb button. | -
RightThumbUp |
- number | -number | -Right thumb not touching primary or secondary thumb buttons. | -
LeftPrimaryIndexTouch |
- number | -number | -Left index finger is touching primary index finger control. | -
LeftIndexPoint |
- number | -number | -Left index finger is pointing, not touching primary or secondary index finger controls. | -
RightPrimaryIndexTouch |
- number | -number | -Right index finger is touching primary index finger control. | -
RightIndexPoint |
- number | -number | -Right index finger is pointing, not touching primary or secondary index finger controls. | -
Avatar Skeleton | -|||
Head |
- number | -- Pose - | -Head pose. | -
LeftHand |
- number | -- Pose - | -Left hand pose. | -
RightHand |
- number | -- Pose - | -right hand pose. | -
Hardware-Vive
-The Controller.Hardware.Vive
object has properties representing Vive. The property values are integer IDs, uniquely identifying each output. Read-only. These can be mapped to actions or functions or Controller.Standard
items in a
- RouteObject mapping.
Property | -Type | -Data | -Description | -
---|---|---|---|
Touch Pad (Sticks) | -|||
LX |
- number | -number | -Left touch pad x-axis scale. | -
LY |
- number | -number | -Left touch pad y-axis scale. | -
RX |
- number | -number | -Right stick x-axis scale. | -
RY |
- number | -number | -Right stick y-axis scale. | -
LS |
- number | -number | -Left touch pad pressed. | -
LS_CENTER |
- number | -number | -Left touch pad center pressed. | -
LS_X |
- number | -number | -Left touch pad pressed x-coordinate. | -
LS_Y |
- number | -number | -Left touch pad pressed y-coordinate. | -
RS |
- number | -number | -Right touch pad pressed. | -
RS_CENTER |
- number | -number | -Right touch pad center pressed. | -
RS_X |
- number | -number | -Right touch pad pressed x-coordinate. | -
RS_Y |
- number | -number | -Right touch pad pressed y-coordinate. | -
LSTouch |
- number | -number | -Left touch pad is touched. | -
RSTouch |
- number | -number | -Right touch pad is touched. | -
Triggers | -|||
LT |
- number | -number | -Left trigger scale. | -
RT |
- number | -number | -Right trigger scale. | -
LTClick |
- number | -number | -Left trigger click. | -
RTClick |
- number | -number | -Right trigger click. | -
LeftGrip |
- number | -number | -Left grip scale. | -
RightGrip |
- number | -number | -Right grip scale. | -
Avatar Skeleton | -|||
Hips |
- number | -- Pose - | -Hips pose. | -
Spine2 |
- number | -- Pose - | -Spine2 pose. | -
Head |
- number | -- Pose - | -Head pose. | -
LeftArm |
- number | -- Pose - | -Left arm pose. | -
RightArm |
- number | -- Pose - | -Right arm pose | -
LeftHand |
- number | -- Pose - | -Left hand pose. | -
RightHand |
- number | -- Pose - | -Right hand pose. | -
Trackers | -|||
TrackedObject00 |
- number | -- Pose - | -Tracker 0 pose. | -
TrackedObject01 |
- number | -- Pose - | -Tracker 1 pose. | -
TrackedObject02 |
- number | -- Pose - | -Tracker 2 pose. | -
TrackedObject03 |
- number | -- Pose - | -Tracker 3 pose. | -
TrackedObject04 |
- number | -- Pose - | -Tracker 4 pose. | -
TrackedObject05 |
- number | -- Pose - | -Tracker 5 pose. | -
TrackedObject06 |
- number | -- Pose - | -Tracker 6 pose. | -
TrackedObject07 |
- number | -- Pose - | -Tracker 7 pose. | -
TrackedObject08 |
- number | -- Pose - | -Tracker 8 pose. | -
TrackedObject09 |
- number | -- Pose - | -Tracker 9 pose. | -
TrackedObject10 |
- number | -- Pose - | -Tracker 10 pose. | -
TrackedObject11 |
- number | -- Pose - | -Tracker 11 pose. | -
TrackedObject12 |
- number | -- Pose - | -Tracker 12 pose. | -
TrackedObject13 |
- number | -- Pose - | -Tracker 13 pose. | -
TrackedObject14 |
- number | -- Pose - | -Tracker 14 pose. | -
TrackedObject15 |
- number | -- Pose - | -Tracker 15 pose. | -
MappingJSON
-Type:
--
-
- object -
Properties:
-Name | -Type | -Description | -
---|---|---|
name |
- string | -The name of the mapping. | -
channels |
- Array.<Controller.MappingJSONRoute> | -An array of routes. | -
Example
-A simple mapping JSON that makes the right trigger move your avatar up after a dead zone.
{
- "name": "com.highfidelity.controllers.example.jsonMapping",
- "channels": [
- {
- "from": "Standard.RT",
- "filters": { "type": "deadZone", "min": 0.05 },
- "to": "Actions.TranslateY"
- }
- ]
-}
- MappingJSONAxis
-Type:
--
-
- object -
Properties:
-Name | -Type | -Description | -
---|---|---|
makeAxis |
- Array.<Array.<string>> | -A two-member array of single-member arrays of
- Controller.Hardware property names. The leading "Controller.Hardware." can be omitted from the property names. |
-
Example
-An axis using the keyboard's left and right keys.
{ "makeAxis" : [
- ["Keyboard.Left"],
- ["Keyboard.Right"]
- ]
-}
- MappingJSONFilter
-Type:
--
-
- object -
Properties:
-Name | -Type | -Attributes | -Description | -
---|---|---|---|
type |
- string | -- | The name of the filter, being the name of the one of the - RouteObject's filter methods. | -
? |
- string | - <optional>
- - |
- If the filter method has a first parameter, the property name is the name of that parameter and the property value is the value to use. | -
? |
- string | - <optional>
- - |
- If the filter method has a second parameter, the property name is the name of that parameter and the property value is the value to use. | -
Example
-A hysteresis filter.
{
- "type": "hysteresis",
- "min": 0.85,
- "max": 0.9
-}
- MappingJSONRoute
-Type:
--
-
- object -
Properties:
-Name | -Type | -Attributes | -Default | -Description | -
---|---|---|---|---|
from |
- string | Controller.MappingJSONAxis | -- | - | The name of a
- Controller.Hardware property name or an axis made from them. If a property name, the leading "Controller.Hardware." can be omitted. |
-
peek |
- boolean | - <optional>
- - |
- false | -If
- |
-
debug |
- boolean | - <optional>
- - |
- false | -If true then debug is enabled per
- RouteObject#debug. |
-
when |
- string | Array.<string> | - <optional>
- - |
- [] | -One or more numeric
- Controller.Hardware property names which are evaluated as booleans and ANDed together. Prepend with a ! to use the logical NOT of the property value. The leading "Controller.Hardware." can be omitted from
- the property names. |
-
filters |
- Controller.MappingJSONFilter | Array.<Controller.MappingJSONFilter> | - <optional>
- - |
- [] | -One or more filters in the route. | -
to |
- string | -- | - | The name of a
- Controller.Actions or
- Controller.Standard property. The leading "Controller." can be omitted. |
-
Standard
-The Controller.Standard
object has properties representing standard controller outputs. Those for physical controllers are based on the XBox controller, with aliases for PlayStation. The property values are integer IDs, uniquely
- identifying each output. Read-only. These can be mapped to actions or functions in a
- RouteObject mapping.
The data value provided by each control is either a number or a
- Pose. Numbers are typically normalized to 0.0
or 1.0
for button states, the range 0.0 – 1.0
for unidirectional scales, and the range -1.0 – 1.0
for bidirectional scales.
Each hardware device has a mapping from its outputs to Controller.Standard
items, specified in a JSON file. For example,
- leapmotion.json and
- vive.json.
Property | -Type | -Data | -Description | -
---|---|---|---|
Buttons | -|||
A |
- number | -number | -"A" button pressed. | -
B |
- number | -number | -"B" button pressed. | -
X |
- number | -number | -"X" button pressed. | -
Y |
- number | -number | -"Y" button pressed. | -
DL |
- number | -number | -D-pad left pressed. | -
DR |
- number | -number | -D-pad right pressed. | -
DU |
- number | -number | -D-pad up pressed. | -
DD |
- number | -number | -D-pad down pressed. | -
Start |
- number | -number | -"Start" center button pressed. | -
Back |
- number | -number | -"Back" center button pressed. | -
LB |
- number | -number | -Left bumper button pressed. | -
RB |
- number | -number | -Right bumper button pressed. | -
Sticks | -|||
LX |
- number | -number | -Left stick x-axis scale. | -
LY |
- number | -number | -Left stick y-axis scale. | -
RX |
- number | -number | -Right stick x-axis scale. | -
RY |
- number | -number | -Right stick y-axis scale. | -
LS |
- number | -number | -Left stick button pressed. | -
RS |
- number | -number | -Right stick button pressed. | -
LSTouch |
- number | -number | -Left stick is touched. | -
RSTouch |
- number | -number | -Right stick is touched. | -
Triggers | -|||
LT |
- number | -number | -Left trigger scale. | -
RT |
- number | -number | -Right trigger scale. | -
LTClick |
- number | -number | -Left trigger click. | -
RTClick |
- number | -number | -Right trigger click. | -
LeftGrip |
- number | -number | -Left grip scale. | -
RightGrip |
- number | -number | -Right grip scale. | -
LeftGripTouch |
- number | -number | -Left grip is touched. | -
RightGripTouch |
- number | -number | -Right grip is touched. | -
Aliases, PlayStation Style Names | -|||
Cross |
- number | -number | -Alias for A . |
-
Circle |
- number | -number | -Alias for B . |
-
Square |
- number | -number | -Alias for X . |
-
Triangle |
- number | -number | -Alias for Y . |
-
Left |
- number | -number | -Alias for DL . |
-
Right |
- number | -number | -Alias for DR . |
-
Up |
- number | -number | -Alias for DU . |
-
Down |
- number | -number | -Alias for DD . |
-
Select |
- number | -number | -Alias for Back . |
-
L1 |
- number | -number | -Alias for LB . |
-
R1 |
- number | -number | -Alias for RB . |
-
L3 |
- number | -number | -Alias for LS . |
-
R3 |
- number | -number | -Alias for RS . |
-
L2 |
- number | -number | -Alias for LT . |
-
R2 |
- number | -number | -Alias for RT . |
-
Finger Abstractions | -|||
LeftPrimaryThumb |
- number | -number | -Left primary thumb button pressed. | -
LeftSecondaryThumb |
- number | -number | -Left secondary thumb button pressed. | -
RightPrimaryThumb |
- number | -number | -Right primary thumb button pressed. | -
RightSecondaryThumb |
- number | -number | -Right secondary thumb button pressed. | -
LeftPrimaryThumbTouch |
- number | -number | -Left thumb touching primary thumb button. | -
LeftSecondaryThumbTouch |
- number | -number | -Left thumb touching secondary thumb button. | -
LeftThumbUp |
- number | -number | -Left thumb not touching primary or secondary thumb buttons. | -
RightPrimaryThumbTouch |
- number | -number | -Right thumb touching primary thumb button. | -
RightSecondaryThumbTouch |
- number | -number | -Right thumb touching secondary thumb button. | -
RightThumbUp |
- number | -number | -Right thumb not touching primary or secondary thumb buttons. | -
LeftPrimaryIndex |
- number | -number | -Left primary index control pressed. To Do: Implement this for current controllers. | -
LeftSecondaryIndex |
- number | -number | -Left secondary index control pressed. | -
RightPrimaryIndex |
- number | -number | -Right primary index control pressed. To Do: Implement this for current controllers. | -
RightSecondaryIndex |
- number | -number | -Right secondary index control pressed. | -
LeftPrimaryIndexTouch |
- number | -number | -Left index finger is touching primary index finger control. | -
LeftSecondaryIndexTouch |
- number | -number | -Left index finger is touching secondary index finger control. | -
LeftIndexPoint |
- number | -number | -Left index finger is pointing, not touching primary or secondary index finger controls. | -
RightPrimaryIndexTouch |
- number | -number | -Right index finger is touching primary index finger control. | -
RightSecondaryIndexTouch |
- number | -number | -Right index finger is touching secondary index finger control. | -
RightIndexPoint |
- number | -number | -Right index finger is pointing, not touching primary or secondary index finger controls. | -
Avatar Skeleton | -|||
Hips |
- number | -- Pose - | -Hips pose. | -
Spine2 |
- number | -- Pose - | -Spine2 pose. | -
Head |
- number | -- Pose - | -Head pose. | -
LeftArm |
- number | -- Pose - | -Left arm pose. | -
RightArm |
- number | -- Pose - | -Right arm pose | -
LeftHand |
- number | -- Pose - | -Left hand pose. | -
LeftHandThumb1 |
- number | -- Pose - | -Left thumb 1 finger joint pose. | -
LeftHandThumb2 |
- number | -- Pose - | -Left thumb 2 finger joint pose. | -
LeftHandThumb3 |
- number | -- Pose - | -Left thumb 3 finger joint pose. | -
LeftHandThumb4 |
- number | -- Pose - | -Left thumb 4 finger joint pose. | -
LeftHandIndex1 |
- number | -- Pose - | -Left index 1 finger joint pose. | -
LeftHandIndex2 |
- number | -- Pose - | -Left index 2 finger joint pose. | -
LeftHandIndex3 |
- number | -- Pose - | -Left index 3 finger joint pose. | -
LeftHandIndex4 |
- number | -- Pose - | -Left index 4 finger joint pose. | -
LeftHandMiddle1 |
- number | -- Pose - | -Left middle 1 finger joint pose. | -
LeftHandMiddle2 |
- number | -- Pose - | -Left middle 2 finger joint pose. | -
LeftHandMiddle3 |
- number | -- Pose - | -Left middle 3 finger joint pose. | -
LeftHandMiddle4 |
- number | -- Pose - | -Left middle 4 finger joint pose. | -
LeftHandRing1 |
- number | -- Pose - | -Left ring 1 finger joint pose. | -
LeftHandRing2 |
- number | -- Pose - | -Left ring 2 finger joint pose. | -
LeftHandRing3 |
- number | -- Pose - | -Left ring 3 finger joint pose. | -
LeftHandRing4 |
- number | -- Pose - | -Left ring 4 finger joint pose. | -
LeftHandPinky1 |
- number | -- Pose - | -Left pinky 1 finger joint pose. | -
LeftHandPinky2 |
- number | -- Pose - | -Left pinky 2 finger joint pose. | -
LeftHandPinky3 |
- number | -- Pose - | -Left pinky 3 finger joint pose. | -
LeftHandPinky4 |
- number | -- Pose - | -Left pinky 4 finger joint pose. | -
RightHand |
- number | -- Pose - | -Right hand pose. | -
RightHandThumb1 |
- number | -- Pose - | -Right thumb 1 finger joint pose. | -
RightHandThumb2 |
- number | -- Pose - | -Right thumb 2 finger joint pose. | -
RightHandThumb3 |
- number | -- Pose - | -Right thumb 3 finger joint pose. | -
RightHandThumb4 |
- number | -- Pose - | -Right thumb 4 finger joint pose. | -
RightHandIndex1 |
- number | -- Pose - | -Right index 1 finger joint pose. | -
RightHandIndex2 |
- number | -- Pose - | -Right index 2 finger joint pose. | -
RightHandIndex3 |
- number | -- Pose - | -Right index 3 finger joint pose. | -
RightHandIndex4 |
- number | -- Pose - | -Right index 4 finger joint pose. | -
RightHandMiddle1 |
- number | -- Pose - | -Right middle 1 finger joint pose. | -
RightHandMiddle2 |
- number | -- Pose - | -Right middle 2 finger joint pose. | -
RightHandMiddle3 |
- number | -- Pose - | -Right middle 3 finger joint pose. | -
RightHandMiddle4 |
- number | -- Pose - | -Right middle 4 finger joint pose. | -
RightHandRing1 |
- number | -- Pose - | -Right ring 1 finger joint pose. | -
RightHandRing2 |
- number | -- Pose - | -Right ring 2 finger joint pose. | -
RightHandRing3 |
- number | -- Pose - | -Right ring 3 finger joint pose. | -
RightHandRing4 |
- number | -- Pose - | -Right ring 4 finger joint pose. | -
RightHandPinky1 |
- number | -- Pose - | -Right pinky 1 finger joint pose. | -
RightHandPinky2 |
- number | -- Pose - | -Right pinky 2 finger joint pose. | -
RightHandPinky3 |
- number | -- Pose - | -Right pinky 3 finger joint pose. | -
RightHandPinky4 |
- number | -- Pose - | -Right pinky 4 finger joint pose. | -
LeftFoot |
- number | -- Pose - | -Left foot pose. | -
RightFoot |
- number | -- Pose - | -Right foot pose. | -
Trackers | -|||
TrackedObject00 |
- number | -- Pose - | -Tracker 0 pose. | -
TrackedObject01 |
- number | -- Pose - | -Tracker 1 pose. | -
TrackedObject02 |
- number | -- Pose - | -Tracker 2 pose. | -
TrackedObject03 |
- number | -- Pose - | -Tracker 3 pose. | -
TrackedObject04 |
- number | -- Pose - | -Tracker 4 pose. | -
TrackedObject05 |
- number | -- Pose - | -Tracker 5 pose. | -
TrackedObject06 |
- number | -- Pose - | -Tracker 6 pose. | -
TrackedObject07 |
- number | -- Pose - | -Tracker 7 pose. | -
TrackedObject08 |
- number | -- Pose - | -Tracker 8 pose. | -
TrackedObject09 |
- number | -- Pose - | -Tracker 9 pose. | -
TrackedObject10 |
- number | -- Pose - | -Tracker 10 pose. | -
TrackedObject11 |
- number | -- Pose - | -Tracker 11 pose. | -
TrackedObject12 |
- number | -- Pose - | -Tracker 12 pose. | -
TrackedObject13 |
- number | -- Pose - | -Tracker 13 pose. | -
TrackedObject14 |
- number | -- Pose - | -Tracker 14 pose. | -
TrackedObject15 |
- number | -- Pose - | -Tracker 15 pose. | -