WVR_GetInputTouchState¶
- WVR_EXPORT bool WVR_GetInputTouchState(WVR_DeviceType type, WVR_InputId id)
Function to get touch state of specific input id.
- Return
- bool, true for touched and false is untouched
- Parameters
- type -
which indicates what device type. (refer to WVR_DeviceType)
- idone -
of WVR_InputId, indicate which touch
- type -
How to use¶
Here is an example for the function:
#include <wvr/wvr_device.h>
WVR_DeviceType controllerArray[] = {WVR_DeviceType_Controller_Right, WVR_DeviceType_Controller_Left};
int controllerCount = sizeof(controllerArray)/sizeof(controllerArray[0]);
for (int idx = 0; idx < controllerCount; idx++) {
if (WVR_GetInputTouchState(controllerArray[idx], WVR_InputId_Alias1_Trigger)) {
LOGI("Controller device Trigger button was touched");
}
- enum WVR_InputId¶
The input id of device.
Values:
- WVR_InputId_0 = 0¶
- WVR_InputId_1 = 1¶
- WVR_InputId_2 = 2¶
- WVR_InputId_3 = 3¶
- WVR_InputId_4 = 4¶
- WVR_InputId_5 = 5¶
- WVR_InputId_6 = 6¶
- WVR_InputId_7 = 7¶
- WVR_InputId_8 = 8¶
- WVR_InputId_9 = 9¶
- WVR_InputId_16 = 16¶
- WVR_InputId_17 = 17¶
- WVR_InputId_Alias1_System = WVR_InputId_0¶
System Button.
- WVR_InputId_Alias1_Menu = WVR_InputId_1¶
Menu Button.
- WVR_InputId_Alias1_Grip = WVR_InputId_2¶
Grip Button.
- WVR_InputId_Alias1_DPad_Left = WVR_InputId_3¶
Virtual DPad_Left Button on Touchpad.
- WVR_InputId_Alias1_DPad_Up = WVR_InputId_4¶
Virtual DPad_Up Button on Touchpad.
- WVR_InputId_Alias1_DPad_Right = WVR_InputId_5¶
Virtual DPad_Right Button on Touchpad.
- WVR_InputId_Alias1_DPad_Down = WVR_InputId_6¶
Virtual DPad_Down Button on Touchpad.
- WVR_InputId_Alias1_Volume_Up = WVR_InputId_7¶
Volume_Up Button.
- WVR_InputId_Alias1_Volume_Down = WVR_InputId_8¶
Volume_Down Button.
- WVR_InputId_Alias1_Bumper = WVR_InputId_9¶
Bumper Button.
- WVR_InputId_Alias1_Touchpad = WVR_InputId_16¶
Touchpad input device.
- WVR_InputId_Alias1_Trigger = WVR_InputId_17¶
Trigger input device.
- WVR_InputId_Max = 32¶