WVR_SetGazeTriggerType¶
-
WVR_EXPORT bool WVR_SetGazeTriggerType(WVR_GazeTriggerType type)
Function to set the gaze trigger type of the application.
- Return
- bool, true when set successfully.
- Version
- API Level 2
- Note
- Effective with Runtime version 2 or higher
- Parameters
type
: Indicate WVR_GazeTriggerType.
How to use¶
This function is programmed for setup gaze trigger type. If the API level is lower than 2, this function would be disabled.
Here is an example for the function:
#include <wvr/wvr_device.h>
WVR_GazeTriggerType mGazeTriggerType;
mGazeTriggerType = WVR_GetGazeTriggerType();
if (mGazeTriggerType == WVR_GazeTriggerType_Timeout) {
mGazeTriggerType = WVR_GazeTriggerType_Button;
} else if (mGazeTriggerType == WVR_GazeTriggerType_Button) {
mGazeTriggerType = WVR_GazeTriggerType_TimeoutButton;
} else if (mGazeTriggerType == WVR_GazeTriggerType_TimeoutButton) {
mGazeTriggerType = WVR_GazeTriggerType_Timeout;
}
WVR_SetGazeTriggerType(mGazeTriggerType);
In this example, it uses WVR_GetGazeTriggerType() to get the value of current gaze trigger type. Then the example sets a value of gaze trigger type by controller button if current gaze trigger type is gaze timeout, otherwise it sets allowing both gaze timeout and controller button if cruurent type is controller button only or it sets gaze timeout only if current type is allowing both gaze timeout and controller button.
After switching gaze trigger type phase, WVR_SetGazeTriggerType() is called to setup gaze trigger type with the value.