WVR_SetInteractionMode

WVR_EXPORT bool WVR_SetInteractionMode(WVR_InteractionMode mode)

Function to set the interaction mode of the application.

Return
bool, true for when setting is successfully.
Version
API Level 2
Note
Effective with Runtime version 2 or higher
Parameters

How to use

This function is programmed for setup user interaction mode. If the API level is lower than 2, this function would be disabled. During runtime, OEM service would receive “VREventType_InteractionModeChanged” event after calling WVR_SetInteractionMode(). Once using “WVR_SetInteractionMode(WVR_InteractionMode_SystemDefault)”, application would receive interaction mode value and reset system gaze trigger type from OEM service at the same time. The default value of interaction mode of OEM service is base on various VR projects.

Here is an example for the function:

#include <wvr/wvr_device.h>

WVR_InteractionMode mInteractionMode;
mInteractionMode = WVR_GetInteractionMode();

if (mInteractionMode == WVR_InteractionMode_SystemDefault) {
    mInteractionMode = WVR_InteractionMode_Gaze;
} else if (mInteractionMode == WVR_InteractionMode_Gaze) {
    mInteractionMode = WVR_InteractionMode_Controller;
} else if (mInteractionMode == WVR_InteractionMode_Controller) {
    mInteractionMode = WVR_InteractionMode_SystemDefault;
}

WVR_SetInteractionMode(mInteractionMode);

In this example, it uses WVR_GetInteractionMode() to get the value of current interaction mode. Then the example sets an value of interaction mode by gaze mode if current interaction mode is system default, otherwise it sets controller mode if cruurent mode is gaze mode or sets system default if current mode is controller mode.

After switching interaction mode phase, WVR_SetInteractionMode() is called to set interaction mode with the value.

enum WVR_InteractionMode

The interaction mode of the application.

Values:

WVR_InteractionMode_SystemDefault = 1

Reset WVR_InteractionMode and WVR_GazeTriggerType to the default system values. Refer to WVR_SetInteractionMode.

WVR_InteractionMode_Gaze = 2

Gaze mode only.

WVR_InteractionMode_Controller = 3

The application uses the controller if a controller is connected; otherwise the application switches to gaze.