diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index dcc91a66fc..59f4934dca 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -664,9 +664,10 @@ private: /**jsdoc *

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 {@link RouteObject} mapping (e.g., using the {@link RouteObject#when} method). - * Each data value is either 1.0 for "true" or 0.0 for "false".

+ * values are integer IDs, uniquely identifying each output. Read-only.

+ *

These states can be mapped to actions or functions or Controller.Standard items in a {@link RouteObject} + * mapping (e.g., using the {@link RouteObject#when} method). Each data value is either 1.0 for "true" or + * 0.0 for "false".

* * * @@ -680,13 +681,17 @@ private: * * * - * + * + * * * * * * + * + * + * * *
PropertyTypeDataDescription
CameraIndependentnumbernumberThe camera is in independent mode.
CameraEntitynumbernumberThe camera is in entity mode.
InHMDnumbernumberThe user is in HMD mode.
AdvancedMovementnumbernumberAdvanced movement controls are enabled. - *
AdvancedMovementnumbernumberAdvanced movement (walking) controls are + * enabled.
StrafeEnablednumbernumberStrafing is enabled
LeftHandDominantnumbernumberDominant hand set to left.
RightHandDominantnumbernumberDominant hand set to right.
SnapTurnnumbernumberSnap turn is enabled.
GroundednumbernumberThe user's avatar is on the ground.
NavigationFocusednumbernumberNot used.
PlatformWindowsnumbernumberThe operating system is Windows.
PlatformMacnumbernumberThe operating system is Mac.
PlatformAndroidnumbernumberThe operating system is Android.
* @typedef {object} Controller.Hardware-Application diff --git a/interface/src/scripting/ControllerScriptingInterface.h b/interface/src/scripting/ControllerScriptingInterface.h index 9701c911b8..4fb631463e 100644 --- a/interface/src/scripting/ControllerScriptingInterface.h +++ b/interface/src/scripting/ControllerScriptingInterface.h @@ -26,18 +26,20 @@ class ScriptEngine; /**jsdoc - * The Controller API provides facilities to interact with computer and controller hardware. + * The Controller API provides facilities to interact with computer and controller hardware. * - *
Functions
+ *

Facilities

* - *

Properties

+ *

Properties

+ *

Get Controller property trees.

* * - *

Mappings

+ *

Mappings

+ *

Create and enable or disable Controller mappings.

* * - *

Input, Hardware, and Action Reflection

+ *

Input, Hardware, and Action Reflection

+ *

Information on the devices and actions available.

* * - *

Input, Hardware, and Action Events

+ *

Input, Hardware, and Action Signals

+ *

Notifications of device and action events.

* * - *

Mouse, Keyboard, and Touch Events

+ *

Mouse, Keyboard, and Touch Signals

+ *

Notifications of mouse, keyboard, and touch events.

* * - *

Control Capturing

+ *

Control Capturing

+ *

Disable and enable the processing of mouse and touch events.

* * - *

Action Capturing

+ *

Action Capturing

+ *

Disable and enable controller actions.

* * - *

Controller and Action Values

+ *

Controller and Action Values

+ *

Get the current value of controller outputs and actions.

* * - *

Haptics

+ *

Haptics

+ *

Trigger haptic pulses.

* * - *

Display Information

+ *

Display Information

+ *

Get information on the display.

* * - *

Virtual Game Pad

+ *

Virtual Game Pad

+ *

Use the virtual game pad which is available on some devices.

* * - *

Input Recordings

+ *

Input Recordings

+ *

Create and play input recordings.

* * - *
Entity Methods:
+ *

Entity Methods

* *

The default scripts implement hand controller actions that use {@link Entities.callEntityMethod} to call entity script - * methods, if present in the entity being interacted with.

+ * methods, if present, in the entity being interacted with.

* * * @@ -203,7 +217,7 @@ class ScriptEngine; * * @property {Controller.Actions} Actions - Predefined actions on Interface and the user's avatar. These can be used as end * points in a {@link RouteObject} mapping. A synonym for Controller.Hardware.Actions. - * Read-only.
+ * Read-only.

* Default mappings are provided from the Controller.Hardware.Keyboard and Controller.Standard to * actions in * @@ -217,7 +231,7 @@ class ScriptEngine; * controller outputs. Read-only. * * @property {Controller.Standard} Standard - Standard controller outputs that can be mapped to Actions or - * functions in a {@link RouteObject} mapping. Read-only.
+ * functions in a {@link 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 @@ -253,7 +267,7 @@ public: public slots: /**jsdoc - * Disable default Interface actions for a particular key event. + * Disables default Interface actions for a particular key event. * @function Controller.captureKeyEvents * @param {KeyEvent} event - 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. @@ -272,7 +286,7 @@ public slots: virtual void captureKeyEvents(const KeyEvent& event); /**jsdoc - * Re-enable default Interface actions for a particular key event that has been disabled using + * Re-enables default Interface actions for a particular key event that has been disabled using * {@link Controller.captureKeyEvents|captureKeyEvents}. * @function Controller.releaseKeyEvents * @param {KeyEvent} event - Details of the key event to release from capture. The key property must be @@ -281,7 +295,7 @@ public slots: virtual void releaseKeyEvents(const KeyEvent& event); /**jsdoc - * Disable default Interface actions for a joystick. + * Disables default Interface actions for a joystick. * @function Controller.captureJoystick * @param {number} joystickID - The integer ID of the joystick. * @deprecated This function is deprecated and will be removed. It no longer has any effect. @@ -289,7 +303,7 @@ public slots: virtual void captureJoystick(int joystickIndex); /**jsdoc - * Re-enable default Interface actions for a joystick that has been disabled using + * Re-enables default Interface actions for a joystick that has been disabled using * {@link Controller.captureJoystick|captureJoystick}. * @function Controller.releaseJoystick * @param {number} joystickID - The integer ID of the joystick. @@ -298,7 +312,7 @@ public slots: virtual void releaseJoystick(int joystickIndex); /**jsdoc - * Disable {@link Entities.mousePressOnEntity} and {@link Entities.mouseDoublePressOnEntity} events on entities. + * Disables {@link Entities.mousePressOnEntity} and {@link Entities.mouseDoublePressOnEntity} events on entities. * @function Controller.captureEntityClickEvents * @example * Entities.mousePressOnEntity.connect(function (entityID, event) { @@ -316,7 +330,7 @@ public slots: virtual void captureEntityClickEvents(); /**jsdoc - * Re-enable {@link Entities.mousePressOnEntity} and {@link Entities.mouseDoublePressOnEntity} events on entities that were + * Re-enables {@link Entities.mousePressOnEntity} and {@link Entities.mouseDoublePressOnEntity} events on entities that were * disabled using {@link Controller.captureEntityClickEvents|captureEntityClickEvents}. * @function Controller.releaseEntityClickEvents */ @@ -324,14 +338,14 @@ public slots: /**jsdoc - * Get the dimensions of the Interface window's interior if in desktop mode or the HUD surface if in HMD mode. + * Gets the dimensions of the Interface window's interior if in desktop mode or the HUD surface if in HMD mode. * @function Controller.getViewportDimensions * @returns {Vec2} The dimensions of the Interface window interior if in desktop mode or HUD surface if in HMD mode. */ virtual glm::vec2 getViewportDimensions() const; /**jsdoc - * Get the recommended area to position UI on the HUD surface if in HMD mode or Interface's window interior if in desktop + * Gets the recommended area to position UI on the HUD surface if in HMD mode or Interface's window interior if in desktop * mode. * @function Controller.getRecommendedHUDRect * @returns {Rect} The recommended area in which to position UI. diff --git a/libraries/controllers/src/controllers/Actions.cpp b/libraries/controllers/src/controllers/Actions.cpp index e34ce277e2..9f9d92fed7 100644 --- a/libraries/controllers/src/controllers/Actions.cpp +++ b/libraries/controllers/src/controllers/Actions.cpp @@ -35,9 +35,9 @@ namespace controller { /**jsdoc *

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 {@link MappingObject}. The data routed to each action is either a number or a - * {@link Pose}.

+ * Interface. The property values are integer IDs, uniquely identifying each action. Read-only.

+ *

These actions can be used as end points in the routes of a {@link MappingObject}. The data item routed to each action + * is either a number or a {@link Pose}.

* *
Disable entity click events for a short period.
* @@ -178,7 +178,7 @@ namespace controller { * person view. * - * + * * * * @@ -238,71 +238,49 @@ namespace controller { * * + * action is deprecated and will be removed. Use RightHand instead. * + * action is deprecated and will be removed. Use BoomIn instead. * + * action is deprecated and will be removed. Use BoomOut instead. * + * action is deprecated and will be removed. Use ContextMenu instead. * + * action is deprecated and will be removed. Use ToggleMute instead. * + * action is deprecated and will be removed. Use TogglePushToTalk instead. * + * action is deprecated and will be removed. Use Sprint instead. * + * action is deprecated and will be removed. Use Backward instead. * + * action is deprecated and will be removed. Use Forward instead. * + * action is deprecated and will be removed. Use StrafeLeft instead. * + * action is deprecated and will be removed. Use StrafeRight instead. * + * action is deprecated and will be removed. Use Up instead. * + * action is deprecated and will be removed. Use Down instead. * + * action is deprecated and will be removed. Use PitchDown instead. * + * action is deprecated and will be removed. Use PitchUp instead. * + * action is deprecated and will be removed. Use YawLeft instead. * + * action is deprecated and will be removed. Use YawRight instead. * + * action is deprecated and will be removed. Use LeftHandClick instead. * + * action is deprecated and will be removed. Use RightHandClick instead. * + * action is deprecated and will be removed. Use Shift instead. * + * action is deprecated and will be removed. Use PrimaryAction instead. * + * action is deprecated and will be removed. Use SecondaryAction instead. * * * @@ -143,7 +143,7 @@ namespace controller { Q_INVOKABLE QVector getDeviceNames(); /**jsdoc - * Find the ID of an action from its name. + * Finds the ID of an action from its name. * @function Controller.findAction * @param {string} actionName - The name of the action: one of the {@link Controller.Actions} property names. * @returns {number} The integer ID of the action if found, otherwise 4095. Note that this value is not @@ -156,7 +156,7 @@ namespace controller { Q_INVOKABLE int findAction(QString actionName); /**jsdoc - * Get the names of all actions available as properties of {@link Controller.Actions}. + * Gets the names of all actions available as properties of {@link Controller.Actions}. * @function Controller.getActionNames * @returns {string[]} An array of action names. * @example @@ -167,7 +167,7 @@ namespace controller { Q_INVOKABLE QVector getActionNames() const; /**jsdoc - * Get the value of a controller button or axis output. Note: Also gets the value of a controller axis output. + * Gets the value of a controller button or axis output. Note: Also gets the value of a controller axis output. * @function Controller.getValue * @param {number} source - The {@link Controller.Standard} or {@link Controller.Hardware} item. * @returns {number} The current value of the controller item output if source is valid, otherwise @@ -186,7 +186,7 @@ namespace controller { Q_INVOKABLE float getValue(const int& source) const; /**jsdoc - * Get the value of a controller axis output. Note: Also gets the value of a controller button output. + * Gets the value of a controller axis output. Note: Also gets the value of a controller button output. * @function Controller.getAxisValue * @param {number} source - The {@link Controller.Standard} or {@link Controller.Hardware} item. * @returns {number} The current value of the controller item output if source is valid, otherwise @@ -196,7 +196,7 @@ namespace controller { Q_INVOKABLE float getAxisValue(int source) const; /**jsdoc - * Get the value of a controller pose output. + * Gets the value of a controller pose output. * @function Controller.getPoseValue * @param {number} source - The {@link Controller.Standard} or {@link Controller.Hardware} pose output. * @returns {Pose} The current value of the controller pose output if source is a pose output, otherwise @@ -210,9 +210,9 @@ namespace controller { /**jsdoc * Triggers a haptic pulse on connected and enabled devices that have the capability. * @function Controller.triggerHapticPulse - * @param {number} strength - The strength of the haptic pulse, 0.01.0. + * @param {number} strength - The strength of the haptic pulse, range 0.01.0. * @param {number} duration - The duration of the haptic pulse, in milliseconds. - * @param {Controller.Hand} hand=2 - The hand or hands to trigger the haptic pulse on. + * @param {Controller.Hand} [hand=2] - The hand or hands to trigger the haptic pulse on. * @example * var HAPTIC_STRENGTH = 0.5; * var HAPTIC_DURATION = 10; @@ -224,8 +224,8 @@ namespace controller { /**jsdoc * Triggers a 250ms haptic pulse on connected and enabled devices that have the capability. * @function Controller.triggerShortHapticPulse - * @param {number} strength - The strength of the haptic pulse, 0.01.0. - * @param {Controller.Hand} hand=2 - The hand or hands to trigger the haptic pulse on. + * @param {number} strength - The strength of the haptic pulse, range 0.01.0. + * @param {Controller.Hand} [hand=2] - The hand or hands to trigger the haptic pulse on. */ Q_INVOKABLE bool triggerShortHapticPulse(float strength, controller::Hand hand = BOTH) const; @@ -233,9 +233,9 @@ namespace controller { * Triggers a haptic pulse on a particular device if connected and enabled and it has the capability. * @function Controller.triggerHapticPulseOnDevice * @param {number} deviceID - The ID of the device to trigger the haptic pulse on. - * @param {number} strength - The strength of the haptic pulse, 0.01.0. + * @param {number} strength - The strength of the haptic pulse, range 0.01.0. * @param {number} duration - The duration of the haptic pulse, in milliseconds. - * @param {Controller.Hand} hand=2 - The hand or hands to trigger the haptic pulse on. + * @param {Controller.Hand} [hand=2] - The hand or hands to trigger the haptic pulse on. * @example * var HAPTIC_STRENGTH = 0.5; * var deviceID = Controller.findDevice("OculusTouch"); @@ -250,19 +250,19 @@ namespace controller { * Triggers a 250ms haptic pulse on a particular device if connected and enabled and it has the capability. * @function Controller.triggerShortHapticPulseOnDevice * @param {number} deviceID - The ID of the device to trigger the haptic pulse on. - * @param {number} strength - The strength of the haptic pulse, 0.01.0. - * @param {Controller.Hand} hand=2 - The hand or hands to trigger the haptic pulse on. + * @param {number} strength - The strength of the haptic pulse, range 0.01.0. + * @param {Controller.Hand} [hand=2] - The hand or hands to trigger the haptic pulse on. */ Q_INVOKABLE bool triggerShortHapticPulseOnDevice(unsigned int device, float strength, controller::Hand hand = BOTH) const; /**jsdoc - * Create a new controller mapping. Routes can then be added to the mapping using {@link MappingObject} methods and + * Creates a new controller mapping. Routes can then be added to the mapping using {@link MappingObject} methods and * routed to Standard controls, Actions, or script functions using {@link RouteObject} * methods. The mapping can then be enabled using {@link Controller.enableMapping|enableMapping} for it to take effect. * @function Controller.newMapping - * @param {string} mappingName=Uuid.generate() - A unique name for the mapping. If not specified a new UUID generated + * @param {string} [mappingName=Uuid.generate()] - A unique name for the mapping. If not specified a new UUID generated * by {@link Uuid.generate} is used. * @returns {MappingObject} A controller mapping object. * @example @@ -279,22 +279,22 @@ namespace controller { Q_INVOKABLE QObject* newMapping(const QString& mappingName = QUuid::createUuid().toString()); /**jsdoc - * Enable or disable a controller mapping. When enabled, the routes in the mapping have effect. + * Enables or disables a controller mapping. When enabled, the routes in the mapping have effect. * @function Controller.enableMapping * @param {string} mappingName - The name of the mapping. - * @param {boolean} enable=true - If true then the mapping is enabled, otherwise it is disabled. + * @param {boolean} [[enable=true] - If true then the mapping is enabled, otherwise it is disabled. */ Q_INVOKABLE void enableMapping(const QString& mappingName, bool enable = true); /**jsdoc - * Disable a controller mapping. When disabled, the routes in the mapping have no effect. + * Disables a controller mapping. When disabled, the routes in the mapping have no effect. * @function Controller.disableMapping * @param {string} mappingName - The name of the mapping. */ Q_INVOKABLE void disableMapping(const QString& mappingName) { enableMapping(mappingName, false); } /**jsdoc - * Create a new controller mapping from a {@link Controller.MappingJSON|MappingJSON} string. Use + * Creates a new controller mapping from a {@link Controller.MappingJSON|MappingJSON} string. Use * {@link Controller.enableMapping|enableMapping} to enable the mapping for it to take effect. * @function Controller.parseMapping * @param {string} jsonString - A JSON string of the {@link Controller.MappingJSON|MappingJSON}. @@ -317,19 +317,19 @@ namespace controller { Q_INVOKABLE QObject* parseMapping(const QString& json); /**jsdoc - * Create a new controller mapping from a {@link Controller.MappingJSON|MappingJSON} JSON file at a URL. Use + * Creates a new controller mapping from a {@link Controller.MappingJSON|MappingJSON} JSON file at a URL. Use * {@link Controller.enableMapping|enableMapping} to enable the mapping for it to take effect. + *

Warning: This function is not yet implemented; it doesn't load a mapping and just returns + * null. * @function Controller.loadMapping * @param {string} jsonURL - The URL the {@link Controller.MappingJSON|MappingJSON} JSON file. * @returns {MappingObject} A controller mapping object. - * @todo Implement this function. It currently does not load the mapping from the file; it just returns - * null. */ Q_INVOKABLE QObject* loadMapping(const QString& jsonUrl); /**jsdoc - * Get the {@link Controller.Hardware} property tree. Calling this function is the same as using the {@link Controller} + * Gets the {@link Controller.Hardware} property tree. Calling this function is the same as using the {@link Controller} * property, Controller.Hardware. * @function Controller.getHardware * @returns {Controller.Hardware} The {@link Controller.Hardware} property tree. @@ -337,7 +337,7 @@ namespace controller { Q_INVOKABLE const QVariantMap getHardware() { return _hardware; } /**jsdoc - * Get the {@link Controller.Actions} property tree. Calling this function is the same as using the {@link Controller} + * Gets the {@link Controller.Actions} property tree. Calling this function is the same as using the {@link Controller} * property, Controller.Actions. * @function Controller.getActions * @returns {Controller.Actions} The {@link Controller.Actions} property tree. @@ -345,7 +345,7 @@ namespace controller { Q_INVOKABLE const QVariantMap getActions() { return _actions; } //undefined /**jsdoc - * Get the {@link Controller.Standard} property tree. Calling this function is the same as using the {@link Controller} + * Gets the {@link Controller.Standard} property tree. Calling this function is the same as using the {@link Controller} * property, Controller.Standard. * @function Controller.getStandard * @returns {Controller.Standard} The {@link Controller.Standard} property tree. @@ -354,7 +354,7 @@ namespace controller { /**jsdoc - * Start making a recording of currently active controllers. + * Starts making a recording of currently active controllers. * @function Controller.startInputRecording * @example

* // Delay start of recording for 2s. @@ -374,13 +374,13 @@ namespace controller { Q_INVOKABLE void startInputRecording(); /**jsdoc - * Stop making a recording started by {@link Controller.startInputRecording|startInputRecording}. + * Stops making a recording started by {@link Controller.startInputRecording|startInputRecording}. * @function Controller.stopInputRecording */ Q_INVOKABLE void stopInputRecording(); /**jsdoc - * Play back the current recording from the beginning. The current recording may have been recorded by + * Plays back the current recording from the beginning. The current recording may have been recorded by * {@link Controller.startInputRecording|startInputRecording} and * {@link Controller.stopInputRecording|stopInputRecording}, or loaded by * {@link Controller.loadInputRecording|loadInputRecording}. Playback repeats in a loop until @@ -403,13 +403,13 @@ namespace controller { Q_INVOKABLE void startInputPlayback(); /**jsdoc - * Stop play back of a recording started by {@link Controller.startInputPlayback|startInputPlayback}. + * Stops play back of a recording started by {@link Controller.startInputPlayback|startInputPlayback}. * @function Controller.stopInputPlayback */ Q_INVOKABLE void stopInputPlayback(); /**jsdoc - * Save the current recording to a file. The current recording may have been recorded by + * Saves the current recording to a file. The current recording may have been recorded by * {@link Controller.startInputRecording|startInputRecording} and * {@link Controller.stopInputRecording|stopInputRecording}, or loaded by * {@link Controller.loadInputRecording|loadInputRecording}. It is saved in the directory returned by @@ -419,24 +419,26 @@ namespace controller { Q_INVOKABLE void saveInputRecording(); /**jsdoc - * Load an input recording, ready for play back. + * Loads an input recording, ready for play back. * @function Controller.loadInputRecording * @param {string} file - The path to the recording file, prefixed by "file:///". */ Q_INVOKABLE void loadInputRecording(const QString& file); /**jsdoc - * Get the directory in which input recordings are saved. + * Gets the directory in which input recordings are saved. * @function Controller.getInputRecorderSaveDirectory * @returns {string} The directory in which input recordings are saved. */ Q_INVOKABLE QString getInputRecorderSaveDirectory(); /**jsdoc - * Get all the active and enabled (running) input devices - * @function Controller.getRunningInputDevices - * @returns {string[]} An array of strings with the names - */ + * Gets the names of all the active and running (enabled) input devices. + * @function Controller.getRunningInputDevices + * @returns {string[]} The list of current active and running input devices. + * @example + * print("Running devices: " + JSON.stringify(Controller.getRunningInputDeviceNames())); + */ Q_INVOKABLE QStringList getRunningInputDeviceNames(); bool isMouseCaptured() const { return _mouseCaptured; } @@ -447,7 +449,7 @@ namespace controller { public slots: /**jsdoc - * Disable processing of mouse "move", "press", "double-press", and "release" events into + * Disables processing of mouse "move", "press", "double-press", and "release" events into * {@link Controller.Hardware|Controller.Hardware.Keyboard} outputs. * @function Controller.captureMouseEvents * @example @@ -475,7 +477,7 @@ namespace controller { virtual void captureMouseEvents() { _mouseCaptured = true; } /**jsdoc - * Enable processing of mouse "move", "press", "double-press", and "release" events into + * Enables processing of mouse "move", "press", "double-press", and "release" events into * {@link Controller.Hardware-Keyboard|Controller.Hardware.Keyboard} outputs that were disabled using * {@link Controller.captureMouseEvents|captureMouseEvents}. * @function Controller.releaseMouseEvents @@ -484,7 +486,7 @@ namespace controller { /**jsdoc - * Disable processing of touch "begin", "update", and "end" events into + * Disables processing of touch "begin", "update", and "end" events into * {@link Controller.Hardware|Controller.Hardware.Keyboard}, * {@link Controller.Hardware|Controller.Hardware.Touchscreen}, and * {@link Controller.Hardware|Controller.Hardware.TouchscreenVirtualPad} outputs. @@ -493,7 +495,7 @@ namespace controller { virtual void captureTouchEvents() { _touchCaptured = true; } /**jsdoc - * Enable processing of touch "begin", "update", and "end" events into + * Enables processing of touch "begin", "update", and "end" events into * {@link Controller.Hardware|Controller.Hardware.Keyboard}, * {@link Controller.Hardware|Controller.Hardware.Touchscreen}, and * {@link Controller.Hardware|Controller.Hardware.TouchscreenVirtualPad} outputs that were disabled using @@ -504,14 +506,14 @@ namespace controller { /**jsdoc - * Disable processing of mouse wheel rotation events into {@link Controller.Hardware|Controller.Hardware.Keyboard} + * Disables processing of mouse wheel rotation events into {@link Controller.Hardware|Controller.Hardware.Keyboard} * outputs. * @function Controller.captureWheelEvents */ virtual void captureWheelEvents() { _wheelCaptured = true; } /**jsdoc - * Enable processing of mouse wheel rotation events into {@link Controller.Hardware|Controller.Hardware.Keyboard} + * Enables processing of mouse wheel rotation events into {@link Controller.Hardware|Controller.Hardware.Keyboard} * outputs that wer disabled using {@link Controller.captureWheelEvents|captureWheelEvents}. * @function Controller.releaseWheelEvents */ @@ -519,7 +521,7 @@ namespace controller { /**jsdoc - * Disable translating and rotating the user's avatar in response to keyboard and controller controls. + * Disables translating and rotating the user's avatar in response to keyboard and controller controls. * @function Controller.captureActionEvents * @example * Script.setTimeout(function () { @@ -533,12 +535,19 @@ namespace controller { virtual void captureActionEvents() { _actionsCaptured = true; } /**jsdoc - * Enable translating and rotating the user's avatar in response to keyboard and controller controls that were disabled + * Enables translating and rotating the user's avatar in response to keyboard and controller controls that were disabled * using {@link Controller.captureActionEvents|captureActionEvents}. * @function Controller.releaseActionEvents */ virtual void releaseActionEvents() { _actionsCaptured = false; } + /**jsdoc + * @function Controller.updateRunningInputDevices + * @param {string} deviceName - Device name. + * @param {boolean} isRunning - Is running. + * @param {string[]} runningDevices - Running devices. + * @deprecated This function is deprecated and will be removed. + */ void updateRunningInputDevices(const QString& deviceName, bool isRunning, const QStringList& runningDevices); signals: @@ -593,7 +602,7 @@ namespace controller { /**jsdoc * Triggered when a device is registered or unregistered by a plugin. Not all plugins generate - * hardwareChanged events: for example connecting or disconnecting a mouse will not generate an event but + * hardwareChanged events: for example, connecting or disconnecting a mouse will not generate an event but * connecting or disconnecting an Xbox controller will. * @function Controller.hardwareChanged * @returns {Signal} @@ -601,13 +610,13 @@ namespace controller { void hardwareChanged(); /**jsdoc - * Triggered when a device is enabled/disabled - * Enabling/Disabling Leapmotion on settings/controls will trigger this signal. - * @function Controller.deviceRunningChanged - * @param {string} deviceName - The name of the device that is getting enabled/disabled - * @param {boolean} isEnabled - Return if the device is enabled. - * @returns {Signal} - */ + * Triggered when an input device starts or stops being active and running (enabled). For example, enabling or + * disabling the LeapMotion in Settings > Controls > Calibration will trigger this signal. + * @function Controller.inputDeviceRunningChanged + * @param {string} deviceName - The name of the device. + * @param {boolean} isRunning - true if the device is active and running, false if it isn't. + * @returns {Signal} + */ void inputDeviceRunningChanged(QString deviceName, bool isRunning); diff --git a/libraries/controllers/src/controllers/StandardController.cpp b/libraries/controllers/src/controllers/StandardController.cpp index e1733d2524..ece10ecca3 100644 --- a/libraries/controllers/src/controllers/StandardController.cpp +++ b/libraries/controllers/src/controllers/StandardController.cpp @@ -30,17 +30,16 @@ void StandardController::focusOutEvent() { /**jsdoc *

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 {@link RouteObject} - * mapping.

- * - *

The data value provided by each control is either a number or a {@link 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.

+ * identifying each output. Read-only.

+ *

These outputs can be mapped to actions or functions in a {@link RouteObject} mapping. The data value provided by each + * control is either a number or a {@link 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.01.0 for bidirectional scales.

+ *

Each hardware device has a mapping from its outputs to a subset of Controller.Standard items, specified in a + * JSON file. For example, + * vive.json + * and + * leapmotion.json.

* *
CycleCameranumbernumberCycle the camera view from first person, to * third person, to full screen mirror, then back to first person and repeat.
ContextMenunumbernumberShow / hide the tablet.
ContextMenunumbernumberShow/hide the tablet.
ToggleMutenumbernumberToggle the microphone mute.
TogglePushToTalknumbernumberToggle push to talk.
ToggleOverlaynumbernumberToggle the display of overlays.
LEFT_HANDnumber{@link Pose}Deprecated: This * action is deprecated and will be removed. Use LeftHand instead.
RIGHT_HANDnumber{@link Pose}Deprecated: This - * action is deprecated and will be removed. Use - * RightHand instead.
BOOM_INnumbernumberDeprecated: This - * action is deprecated and will be removed. Use - * BoomIn instead.
BOOM_OUTnumbernumberDeprecated: This - * action is deprecated and will be removed. Use - * BoomOut instead.
CONTEXT_MENUnumbernumberDeprecated: This - * action is deprecated and will be removed. Use - * ContextMenu instead.
TOGGLE_MUTEnumbernumberDeprecated: This - * action is deprecated and will be removed. Use - * ToggleMute instead.
TOGGLE_PUSHTOTALKnumbernumberDeprecated: This - * action is deprecated and will be removed. Use - * TogglePushToTalk instead.
SPRINTnumbernumberDeprecated: This - * action is deprecated and will be removed. Use - * Sprint instead.
LONGITUDINAL_BACKWARDnumbernumberDeprecated: This - * action is deprecated and will be removed. Use - * Backward instead.
LONGITUDINAL_FORWARDnumbernumberDeprecated: This - * action is deprecated and will be removed. Use - * Forward instead.
LATERAL_LEFTnumbernumberDeprecated: This - * action is deprecated and will be removed. Use - * StrafeLeft instead.
LATERAL_RIGHTnumbernumberDeprecated: This - * action is deprecated and will be removed. Use - * StrafeRight instead.
VERTICAL_UPnumbernumberDeprecated: This - * action is deprecated and will be removed. Use - * Up instead.
VERTICAL_DOWNnumbernumberDeprecated: This - * action is deprecated and will be removed. Use - * Down instead.
PITCH_DOWNnumbernumberDeprecated: This - * action is deprecated and will be removed. Use - * PitchDown instead.
PITCH_UPnumbernumberDeprecated: This - * action is deprecated and will be removed. Use - * PitchUp instead.
YAW_LEFTnumbernumberDeprecated: This - * action is deprecated and will be removed. Use - * YawLeft instead.
YAW_RIGHTnumbernumberDeprecated: This - * action is deprecated and will be removed. Use - * YawRight instead.
LEFT_HAND_CLICKnumbernumberDeprecated: This - * action is deprecated and will be removed. Use - * LeftHandClick instead.
RIGHT_HAND_CLICKnumbernumberDeprecated: This - * action is deprecated and will be removed. Use - * RightHandClick instead.
SHIFTnumbernumberDeprecated: This - * action is deprecated and will be removed. Use - * Shift instead.
ACTION1numbernumberDeprecated: This - * action is deprecated and will be removed. Use - * PrimaryAction instead.
ACTION2numbernumberDeprecated: This - * action is deprecated and will be removed. Use - * SecondaryAction instead.
Deprecated Trackers
TrackedObject00number{@link Pose}Deprecated: diff --git a/libraries/controllers/src/controllers/InputDevice.h b/libraries/controllers/src/controllers/InputDevice.h index 7c3c31cb38..95d0524a4a 100644 --- a/libraries/controllers/src/controllers/InputDevice.h +++ b/libraries/controllers/src/controllers/InputDevice.h @@ -54,10 +54,9 @@ enum Hand { /**jsdoc *

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 {@link RouteObject} mapping. Additionally, hardware-specific controller outputs can be mapped - * to standard controller outputs. - * + * 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 {@link RouteObject} mapping. Additionally, hardware-specific + * controller outputs can be mapped to standard controller outputs. *

Controllers typically implement a subset of the {@link 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 {@link Controller.MappingJSON|MappingJSON} files at diff --git a/libraries/controllers/src/controllers/ScriptingInterface.cpp b/libraries/controllers/src/controllers/ScriptingInterface.cpp index 07c59e1aaa..fd32b2eb43 100644 --- a/libraries/controllers/src/controllers/ScriptingInterface.cpp +++ b/libraries/controllers/src/controllers/ScriptingInterface.cpp @@ -227,6 +227,7 @@ namespace controller { } QObject* ScriptingInterface::loadMapping(const QString& jsonUrl) { + // FIXME: Implement. https://highfidelity.manuscript.com/f/cases/14188/Implement-Controller-loadMappping return nullptr; } diff --git a/libraries/controllers/src/controllers/ScriptingInterface.h b/libraries/controllers/src/controllers/ScriptingInterface.h index 156fc1af7c..84396fc8be 100644 --- a/libraries/controllers/src/controllers/ScriptingInterface.h +++ b/libraries/controllers/src/controllers/ScriptingInterface.h @@ -73,7 +73,7 @@ namespace controller { virtual ~ScriptingInterface() {}; /**jsdoc - * Get a list of all available actions. + * Gets a list of all available actions. * @function Controller.getAllActions * @returns {Action[]} All available actions. * @deprecated This function is deprecated and will be removed. It no longer works. @@ -82,7 +82,7 @@ namespace controller { Q_INVOKABLE QVector getAllActions(); /**jsdoc - * Get a list of all available inputs for a hardware device. + * Gets a list of all available inputs for a hardware device. * @function Controller.getAvailableInputs * @param {number} deviceID - Integer ID of the hardware device. * @returns {NamedPair[]} All available inputs for the device. @@ -92,7 +92,7 @@ namespace controller { Q_INVOKABLE QVector getAvailableInputs(unsigned int device); /**jsdoc - * Find the name of a particular controller from its device ID. + * Finds the name of a particular controller from its device ID. * @function Controller.getDeviceName * @param {number} deviceID - The integer ID of the device. * @returns {string} The name of the device if found, otherwise "unknown". @@ -106,7 +106,7 @@ namespace controller { Q_INVOKABLE QString getDeviceName(unsigned int device); /**jsdoc - * Get the current value of an action. + * Gets the current value of an action. * @function Controller.getActionValue * @param {number} actionID - The integer ID of the action. * @returns {number} The current value of the action. @@ -121,7 +121,7 @@ namespace controller { Q_INVOKABLE float getActionValue(int action); /**jsdoc - * Find the ID of a specific controller from its device name. + * Finds the ID of a specific controller from its device name. * @function Controller.findDevice * @param {string} deviceName - The name of the device to find. * @returns {number} The integer ID of the device if available, otherwise 65535. @@ -132,7 +132,7 @@ namespace controller { Q_INVOKABLE int findDevice(QString name); /**jsdoc - * Get the names of all currently available controller devices plus "Actions", "Application", and "Standard". + * Gets the names of all currently available controller devices plus "Actions", "Application", and "Standard". * @function Controller.getDeviceNames * @returns {string[]} An array of device names. * @example

Get the names of all currently available controller devices.Get the names of all actions.Trigger a haptic pulse on the right hand.Trigger a haptic pulse on an Oculus Touch controller.Create a simple mapping that makes the right trigger move your avatar up.Make a controller recording.List all active and running input devices.Disable Controller.Hardware.Keyboard mouse events for a short period.Disable avatar translation and rotation for a short period.
* @@ -119,12 +118,12 @@ void StandardController::focusOutEvent() { * button. * - * + * * * + * * * * var MAPPING_NAME = "com.highfidelity.controllers.example.newMapping"; @@ -193,7 +195,7 @@ class RouteBuilderProxy : public QObject { Q_INVOKABLE QObject* when(const QScriptValue& expression); /**jsdoc - * Filter numeric route values to lie between two values; values outside this range are not passed on through the + * Filters numeric route values to lie between two values; values outside this range are not passed on through the * route. * @function RouteObject#clamp * @param {number} min - The minimum value to pass through. @@ -214,7 +216,7 @@ class RouteBuilderProxy : public QObject { Q_INVOKABLE QObject* clamp(float min, float max); /**jsdoc - * Filter numeric route values such that they are rounded to 0 or 1 without output values + * Filters numeric route values such that they are rounded to 0 or 1 without output values * flickering when the input value hovers around 0.5. For example, this enables you to use an analog input * as if it were a toggle. * @function RouteObject#hysteresis @@ -239,7 +241,7 @@ class RouteBuilderProxy : public QObject { Q_INVOKABLE QObject* hysteresis(float min, float max); /**jsdoc - * Filter numeric route values to send at a specified interval. + * Filters numeric route values to send at a specified interval. * @function RouteObject#pulse * @param {number} interval - The interval between sending values, in seconds. * @returns {RouteObject} The RouteObject with the filter applied. @@ -258,7 +260,7 @@ class RouteBuilderProxy : public QObject { Q_INVOKABLE QObject* pulse(float interval); /**jsdoc - * Filter numeric and {@link Pose} route values to be scaled by a constant amount. + * Filters numeric and {@link Pose} route values to be scaled by a constant amount. * @function RouteObject#scale * @param {number} multiplier - The scale to multiply the value by. * @returns {RouteObject} The RouteObject with the filter applied. @@ -280,7 +282,7 @@ class RouteBuilderProxy : public QObject { Q_INVOKABLE QObject* scale(float multiplier); /**jsdoc - * Filter numeric and {@link Pose} route values to have the opposite sign, e.g., 0.5 is changed to + * Filters numeric and {@link Pose} route values to have the opposite sign, e.g., 0.5 is changed to * -0.5. * @function RouteObject#invert * @returns {RouteObject} The RouteObject with the filter applied. @@ -302,7 +304,7 @@ class RouteBuilderProxy : public QObject { Q_INVOKABLE QObject* invert(); /**jsdoc - * Filter numeric route values such that they're sent only when the input value is outside a dead-zone. When the input + * Filters numeric route values such that they're sent only when the input value is outside a dead-zone. When the input * passes the dead-zone value, output is sent starting at 0.0 and catching up with the input value. As the * input returns toward the dead-zone value, output values reduce to 0.0 at the dead-zone value. * @function RouteObject#deadZone @@ -324,7 +326,7 @@ class RouteBuilderProxy : public QObject { Q_INVOKABLE QObject* deadZone(float min); /**jsdoc - * Filter numeric route values such that they are rounded to -1, 0, or 1. + * Filters numeric route values such that they are rounded to -1, 0, or 1. * For example, this enables you to use an analog input as if it were a toggle or, in the case of a bidirectional axis, * a tri-state switch. * @function RouteObject#constrainToInteger @@ -345,7 +347,7 @@ class RouteBuilderProxy : public QObject { Q_INVOKABLE QObject* constrainToInteger(); /**jsdoc - * Filter numeric route values such that they are rounded to 0 or 1. For example, this + * Filters numeric route values such that they are rounded to 0 or 1. For example, this * enables you to use an analog input as if it were a toggle. * @function RouteObject#constrainToPositiveInteger * @returns {RouteObject} The RouteObject with the filter applied. @@ -364,7 +366,7 @@ class RouteBuilderProxy : public QObject { Q_INVOKABLE QObject* constrainToPositiveInteger(); /**jsdoc - * Filter {@link Pose} route values to have a pre-translation applied. + * Filters {@link Pose} route values to have a pre-translation applied. * @function RouteObject#translate * @param {Vec3} translate - The pre-translation to add to the pose. * @returns {RouteObject} The RouteObject with the pre-translation applied. @@ -373,7 +375,7 @@ class RouteBuilderProxy : public QObject { Q_INVOKABLE QObject* translate(glm::vec3 translate); /**jsdoc - * Filter {@link Pose} route values to have a pre-transform applied. + * Filters {@link Pose} route values to have a pre-transform applied. * @function RouteObject#transform * @param {Mat4} transform - The pre-transform to apply. * @returns {RouteObject} The RouteObject with the pre-transform applied. @@ -382,7 +384,7 @@ class RouteBuilderProxy : public QObject { Q_INVOKABLE QObject* transform(glm::mat4 transform); /**jsdoc - * Filter {@link Pose} route values to have a post-transform applied. + * Filters {@link Pose} route values to have a post-transform applied. * @function RouteObject#postTransform * @param {Mat4} transform - The post-transform to apply. * @returns {RouteObject} The RouteObject with the post-transform applied. @@ -391,7 +393,7 @@ class RouteBuilderProxy : public QObject { Q_INVOKABLE QObject* postTransform(glm::mat4 transform); /**jsdoc - * Filter {@link Pose} route values to have a pre-rotation applied. + * Filters {@link Pose} route values to have a pre-rotation applied. * @function RouteObject#rotate * @param {Quat} rotation - The pre-rotation to add to the pose. * @returns {RouteObject} The RouteObject with the pre-rotation applied. @@ -400,7 +402,7 @@ class RouteBuilderProxy : public QObject { Q_INVOKABLE QObject* rotate(glm::quat rotation); /**jsdoc - * Filter {@link Pose} route values to be smoothed by a low velocity filter. The filter's rotation and translation + * Filters {@link Pose} route values to be smoothed by a low velocity filter. The filter's rotation and translation * values are calculated as: (1 - f) * currentValue + f * previousValue where * f = currentVelocity / filterConstant. At low velocities, the filter value is largely the previous * value; at high velocities the value is wholly the current controller value. @@ -415,7 +417,7 @@ class RouteBuilderProxy : public QObject { Q_INVOKABLE QObject* lowVelocity(float rotationConstant, float translationConstant); /**jsdoc - * Filter {@link Pose} route values to be smoothed by an exponential decay filter. The filter's rotation and + * Filters {@link Pose} route values to be smoothed by an exponential decay filter. The filter's rotation and * translation values are calculated as: filterConstant * currentValue + (1 - filterConstant) * * previousValue. Values near 1 are less smooth with lower latency; values near 0 are more smooth with higher * latency. @@ -428,7 +430,7 @@ class RouteBuilderProxy : public QObject { Q_INVOKABLE QObject* exponentialSmoothing(float rotationConstant, float translationConstant); /**jsdoc - * Filter numeric route values such that a value of 0.0 is changed to 1.0, and other values + * Filters numeric route values such that a value of 0.0 is changed to 1.0, and other values * are changed to 0.0. * @function RouteObject#logicalNot * @returns {RouteObject} The RouteObject with the filter applied. diff --git a/libraries/input-plugins/src/input-plugins/KeyboardMouseDevice.cpp b/libraries/input-plugins/src/input-plugins/KeyboardMouseDevice.cpp index 3383d71a52..0a6c76e456 100755 --- a/libraries/input-plugins/src/input-plugins/KeyboardMouseDevice.cpp +++ b/libraries/input-plugins/src/input-plugins/KeyboardMouseDevice.cpp @@ -219,9 +219,10 @@ controller::Input KeyboardMouseDevice::InputDevice::makeInput(KeyboardMouseDevic /**jsdoc *

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 {@link RouteObject} mapping. For presses, each data - * value is either 1.0 for "true" or 0.0 for "false".

+ * events. The property values are integer IDs, uniquely identifying each output. Read-only.

+ *

These events can be mapped to actions or functions or Controller.Standard items in a {@link RouteObject} + * mapping. For presses, each data value is either 1.0 for "true" or 0.0 for "false".

+ * *
RightThumbUpnumbernumberRight thumb not touching primary or secondary * thumb buttons.
LeftPrimaryIndexnumbernumberLeft primary index control pressed. - * To Do: Implement this for current controllers.
LeftPrimaryIndexnumbernumberLeft primary index control + * pressed.
LeftSecondaryIndexnumbernumberLeft secondary index control pressed. *
RightPrimaryIndexnumbernumberRight primary index control pressed. - * To Do: Implement this for current controllers.
RightSecondaryIndexnumbernumberRight secondary index control pressed. *
LeftPrimaryIndexTouchnumbernumberLeft index finger is touching primary diff --git a/libraries/controllers/src/controllers/impl/MappingBuilderProxy.h b/libraries/controllers/src/controllers/impl/MappingBuilderProxy.h index 845e19f6c3..f0a823a3de 100644 --- a/libraries/controllers/src/controllers/impl/MappingBuilderProxy.h +++ b/libraries/controllers/src/controllers/impl/MappingBuilderProxy.h @@ -84,12 +84,12 @@ class UserInputMapper; /**jsdoc * A route in a {@link Controller.MappingJSON}. * @typedef {object} Controller.MappingJSONRoute - * @property {string|Controller.MappingJSONAxis} from - The name of a {@link Controller.Hardware} property name or an axis - * made from them. If a property name, the leading "Controller.Hardware." can be omitted. - * @property {boolean} [peek=false] - If true then peeking is enabled per {@link RouteObject#peek}. - * @property {boolean} [debug=false] - If true then debug is enabled per {@link RouteObject#debug}. + * @property {string|Controller.MappingJSONAxis} from - The name of a {@link Controller.Hardware} property or an axis made from + * them. If a property name, the leading "Controller.Hardware." can be omitted. + * @property {boolean} [peek=false] - If true, then peeking is enabled per {@link RouteObject#peek}. + * @property {boolean} [debug=false] - If true, then debug is enabled per {@link RouteObject#debug}. * @property {string|string[]} [when=[]] - One or more numeric {@link 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 + * as booleans and ANDed together. Prepend a property name with a ! to do a logical NOT. The leading * "Controller.Hardware." can be omitted from the property names. * @property {Controller.MappingJSONFilter|Controller.MappingJSONFilter[]} [filters=[]] - One or more filters in the route. * @property {string} to - The name of a {@link Controller.Actions} or {@link Controller.Standard} property. The leading @@ -134,7 +134,7 @@ public: : _parent(parent), _mapping(mapping) { } /**jsdoc - * Create a new {@link RouteObject} from a controller output, ready to be mapped to a standard control, action, or + * Creates a new {@link RouteObject} from a controller output, ready to be mapped to a standard control, action, or * function.
* This is a QML-specific version of {@link MappingObject#from|from}: use this version in QML files. * @function MappingObject#fromQml @@ -145,7 +145,7 @@ public: Q_INVOKABLE QObject* fromQml(const QJSValue& source); /**jsdoc - * Create a new {@link RouteObject} from two numeric {@link Controller.Hardware} outputs, one applied in the negative + * Creates a new {@link RouteObject} from two numeric {@link Controller.Hardware} outputs, one applied in the negative * direction and the other in the positive direction, ready to be mapped to a standard control, action, or function.
* This is a QML-specific version of {@link MappingObject#makeAxis|makeAxis}: use this version in QML files. * @function MappingObject#makeAxisQml @@ -157,7 +157,7 @@ public: Q_INVOKABLE QObject* makeAxisQml(const QJSValue& source1, const QJSValue& source2); /**jsdoc - * Create a new {@link RouteObject} from a controller output, ready to be mapped to a standard control, action, or + * Creates a new {@link RouteObject} from a controller output, ready to be mapped to a standard control, action, or * function. * @function MappingObject#from * @param {Controller.Standard|Controller.Hardware|function} source - The controller output or function that is the source @@ -167,7 +167,7 @@ public: Q_INVOKABLE QObject* from(const QScriptValue& source); /**jsdoc - * Create a new {@link RouteObject} from two numeric {@link Controller.Hardware} outputs, one applied in the negative + * Creates a new {@link RouteObject} from two numeric {@link Controller.Hardware} outputs, one applied in the negative * direction and the other in the positive direction, ready to be mapped to a standard control, action, or function. * @function MappingObject#makeAxis * @param {Controller.Hardware} source1 - The first, negative-direction controller output. @@ -189,7 +189,7 @@ public: Q_INVOKABLE QObject* makeAxis(const QScriptValue& source1, const QScriptValue& source2); /**jsdoc - * Enable or disable the mapping. When enabled, the routes in the mapping take effect.
+ * Enables or disables the mapping. When enabled, the routes in the mapping take effect.
* Synonymous with {@link Controller.enableMapping}. * @function MappingObject#enable * @param {boolean} enable=true - If true then the mapping is enabled, otherwise it is disabled. @@ -198,7 +198,7 @@ public: Q_INVOKABLE QObject* enable(bool enable = true); /**jsdoc - * Disable the mapping. When disabled, the routes in the mapping have no effect.
+ * Disables the mapping. When disabled, the routes in the mapping have no effect.
* Synonymous with {@link Controller.disableMapping}. * @function MappingObject#disable * @returns {MappingObject} The mapping object, so that further routes can be added. diff --git a/libraries/controllers/src/controllers/impl/RouteBuilderProxy.cpp b/libraries/controllers/src/controllers/impl/RouteBuilderProxy.cpp index 048e23be1c..56ace23335 100644 --- a/libraries/controllers/src/controllers/impl/RouteBuilderProxy.cpp +++ b/libraries/controllers/src/controllers/impl/RouteBuilderProxy.cpp @@ -66,6 +66,8 @@ QObject* RouteBuilderProxy::peek(bool enable) { } QObject* RouteBuilderProxy::when(const QScriptValue& expression) { + // FIXME: Support "!" conditional in simple expression and array expression. + // Note that "!" is supported when parsing a JSON file, in UserInputMapper::parseConditional(). auto newConditional = _parent.conditionalFor(expression); if (_route->conditional) { _route->conditional = ConditionalPointer(new AndConditional(_route->conditional, newConditional)); diff --git a/libraries/controllers/src/controllers/impl/RouteBuilderProxy.h b/libraries/controllers/src/controllers/impl/RouteBuilderProxy.h index eb610af78a..e7ff04d72c 100644 --- a/libraries/controllers/src/controllers/impl/RouteBuilderProxy.h +++ b/libraries/controllers/src/controllers/impl/RouteBuilderProxy.h @@ -51,7 +51,7 @@ class RouteBuilderProxy : public QObject { : _parent(parent), _mapping(mapping), _route(route) { } /**jsdoc - * Terminate the route with a standard control, an action, or a script function. The output value from the route is + * Terminates the route with a standard control, an action, or a script function. The output value from the route is * sent to the specified destination.
* This is a QML-specific version of {@link MappingObject#to|to}: use this version in QML files. * @function RouteObject#toQml @@ -62,7 +62,7 @@ class RouteBuilderProxy : public QObject { Q_INVOKABLE void toQml(const QJSValue& destination); /**jsdoc - * Process the route only if a condition is satisfied. The condition is evaluated before the route input is read, and + * Processes the route only if a condition is satisfied. The condition is evaluated before the route input is read, and * the input is read only if the condition is true. Thus, if the condition is not met then subsequent * routes using the same input are processed.
* This is a QML-specific version of {@link MappingObject#to|to}: use this version in QML files. @@ -81,7 +81,7 @@ class RouteBuilderProxy : public QObject { Q_INVOKABLE QObject* whenQml(const QJSValue& expression); /**jsdoc - * Terminate the route with a standard control, an action, or a script function. The output value from the route is + * Terminates the route with a standard control, an action, or a script function. The output value from the route is * sent to the specified destination. * @function RouteObject#to * @param {Controller.Standard|Controller.Actions|function} destination - The standard control, action, or JavaScript @@ -117,7 +117,7 @@ class RouteBuilderProxy : public QObject { Q_INVOKABLE void to(const QScriptValue& destination); /**jsdoc - * Enable and disabling writing debug information for a route to the program log. + * Enables or disables writing debug information for a route to the program log. * @function RouteObject#debug * @param {boolean} [enable=true] - If true then writing debug information is enabled for the route, * otherwise it is disabled. @@ -147,7 +147,7 @@ class RouteBuilderProxy : public QObject { Q_INVOKABLE QObject* debug(bool enable = true); /**jsdoc - * Process the route without marking the controller output as having been read, so that other routes from the same + * Processes the route without marking the controller output as having been read, so that other routes from the same * controller output can also process. * @function RouteObject#peek * @param {boolean} [enable=true] - If true then the route is processed without marking the route's @@ -157,7 +157,7 @@ class RouteBuilderProxy : public QObject { Q_INVOKABLE QObject* peek(bool enable = true); /**jsdoc - * Process the route only if a condition is satisfied. The condition is evaluated before the route input is read, and + * Processes the route only if a condition is satisfied. The condition is evaluated before the route input is read, and * the input is read only if the condition is true. Thus, if the condition is not met then subsequent * routes using the same input are processed. * @function RouteObject#when @@ -170,6 +170,8 @@ class RouteBuilderProxy : public QObject { * definition. * *

If an array of conditions is provided, their values are ANDed together.

+ *

Warning: The use of ! is not currently supported in JavaScript .when() + * calls.

* @returns {RouteObject} The RouteObject with the condition added. * @example
Process the right trigger differently in HMD and desktop modes.
* * @@ -269,14 +270,18 @@ controller::Input KeyboardMouseDevice::InputDevice::makeInput(KeyboardMouseDevic * new x-coordinate value. * - * * * + * is the number of units rotated (typically 1.0).
+ * Warning: The mouse wheel in an ordinary mouse generates left/right wheel events instead of + * up/down. * + * is the number of units rotated (typically 1.0).
+ * Warning: The mouse wheel in an ordinary mouse generates left/right wheel events instead of + * up/down. * *
PropertyTypeDataDescription
MouseYnumbernumberThe mouse y-coordinate changed. The data value is its * new y-coordinate value.
MouseWheelRightnumbernumberThe mouse wheel rotated left. The data value + *
MouseWheelRightnumbernumberThe mouse wheel rotated right. The data value * is the number of units rotated (typically 1.0).
MouseWheelLeftnumbernumberThe mouse wheel rotated left. The data value * is the number of units rotated (typically 1.0).
MouseWheelUpnumbernumberThe mouse wheel rotated up. The data value - * is the number of units rotated (typically 1.0).
MouseWheelDownnumbernumberThe mouse wheel rotated down. The data value - * is the number of units rotated (typically 1.0).
TouchpadRightnumbernumberThe average touch on a touch-enabled device * moved right. The data value is how far the average position of all touch points moved.
TouchpadLeftnumbernumberThe average touch on a touch-enabled device @@ -288,7 +293,6 @@ controller::Input KeyboardMouseDevice::InputDevice::makeInput(KeyboardMouseDevic * *
* @typedef {object} Controller.Hardware-Keyboard - * @todo Currently, the mouse wheel in an ordinary mouse generates left/right wheel events instead of up/down. */ controller::Input::NamedVector KeyboardMouseDevice::InputDevice::getAvailableInputs() const { using namespace controller; diff --git a/plugins/oculus/src/OculusControllerManager.cpp b/plugins/oculus/src/OculusControllerManager.cpp index 8d97ff78af..14830f3f04 100644 --- a/plugins/oculus/src/OculusControllerManager.cpp +++ b/plugins/oculus/src/OculusControllerManager.cpp @@ -409,9 +409,10 @@ void OculusControllerManager::TouchDevice::stopHapticPulse(bool leftHand) { } /**jsdoc - *

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 {@link RouteObject} mapping.

+ *

The Controller.Hardware.OculusTouch object has properties representing the Oculus Rift. The property values + * are integer IDs, uniquely identifying each output. Read-only.

+ *

These outputs can be mapped to actions or functions or Controller.Standard items in a {@link RouteObject} + * mapping.

* * * diff --git a/plugins/openvr/src/ViveControllerManager.cpp b/plugins/openvr/src/ViveControllerManager.cpp index 34ebb73fda..c21a9ae4df 100644 --- a/plugins/openvr/src/ViveControllerManager.cpp +++ b/plugins/openvr/src/ViveControllerManager.cpp @@ -1299,14 +1299,20 @@ void ViveControllerManager::InputDevice::setConfigFromString(const QString& valu } /**jsdoc - *

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 {@link RouteObject} mapping.

+ *

The Controller.Hardware.Vive object has properties representing the Vive. The property values are integer + * IDs, uniquely identifying each output. Read-only.

+ *

These outputs can be mapped to actions or functions or Controller.Standard items in a {@link RouteObject} + * mapping.

*
PropertyTypeDataDescription
* * * * + * + * + * * * *
PropertyTypeDataDescription
Buttons
LeftApplicationMenunumbernumberLeft application menu button pressed. + *
RightApplicationMenunumbernumberRight application menu button pressed. + *
Touch Pad (Sticks)
LXnumbernumberLeft touch pad x-axis scale.
LYnumbernumberLeft touch pad y-axis scale.