This website uses cookies to improve our services and deliver relevant ads.
By interacting with this site, you agree to this use. For more information, see our Cookies Policy

Enumerations

enum
ovrButton {
}
Describes button input types.
enum
ovrControllerType {
}
Specifies which controller is connected; multiple can be connected at once.
enum
ovrDeviceIdType {
}
enum
ovrControllerCapabilties {
}
Specifies capabilites of a controller Note that left and right hand are non-exclusive (a two-handed controller could set both)

Typedefs

uint32_t

Functions

ovrResult
vrapi_EnumerateInputDevices ( ovrMobile * ovr, const uint32_t index, ovrInputCapabilityHeader * capsHeader )
Enumerates the input devices connected to the system Start with index=0 and counting up.
ovrResult
Returns the capabilities of the input device for the corresponding device ID.
ovrResult
vrapi_GetCurrentInputState ( ovrMobile * ovr, const ovrDeviceID deviceID, ovrInputStateHeader * inputState )
Returns the current input state for controllers, without positional tracking info.
ovrResult
vrapi_GetInputTrackingState ( ovrMobile * ovr, const ovrDeviceID deviceID, const double absTimeInSeconds, ovrTracking * tracking )
Returns the predicted input state based on the specified absolute system time in seconds.
OVR_VRAPI_DEPRECATED ( void vrapi_RecenterInputPose )
Can be called from any thread while in VR mode.
ovrResult
vrapi_SetRemoteEmulation ( ovrMobile * ovr, const bool emulationOn )
Enable or disable emulation for the GearVR Controller.

Enumeration Type Documentation

enum VrApi_Input.h.ovrButton
Describes button input types.
Enumerator
ovrButton_A= 0x00000001
ovrButton_B= 0x00000002
ovrButton_RThumb= 0x00000004
ovrButton_RShoulder= 0x00000008
ovrButton_X= 0x00000100
ovrButton_Y= 0x00000200
ovrButton_LThumb= 0x00000400
ovrButton_LShoulder= 0x00000800
ovrButton_Up= 0x00010000
ovrButton_Down= 0x00020000
ovrButton_Left= 0x00040000
ovrButton_Right= 0x00080000
ovrButton_Enter= 0x00100000
ovrButton_Back= 0x00200000
ovrButton_EnumSize= 0x7fffffff
enum VrApi_Input.h.ovrControllerType
Specifies which controller is connected; multiple can be connected at once.
Enumerator
ovrControllerType_None= 0
ovrControllerType_Reserved0= ( 1 << 0 )
ovrControllerType_Reserved1= ( 1 << 1 )
ovrControllerType_TrackedRemote= ( 1 << 2 )
ovrControllerType_Headset= ( 1 << 3 )
ovrControllerType_Gamepad= ( 1 << 4 )
ovrControllerType_EnumSize= 0x7fffffff
enum VrApi_Input.h.ovrDeviceIdType
Enumerator
ovrDeviceIdType_Invalid= 0x7fffffff
enum VrApi_Input.h.ovrControllerCapabilties
Specifies capabilites of a controller Note that left and right hand are non-exclusive (a two-handed controller could set both)
Enumerator
ovrControllerCaps_HasOrientationTracking= 0x00000001
ovrControllerCaps_HasPositionTracking= 0x00000002
ovrControllerCaps_LeftHand= 0x00000004
ovrControllerCaps_RightHand= 0x00000008
ovrControllerCaps_ModelOculusGo= 0x00000010
ovrControllerCaps_ModelGearVR= 0x00000800
ovrControllerCaps_HasTrackpad= 0x00001000
ovrControllerCaps_EnumSize= 0x7fffffff

Typedef Documentation

typedef uint32_t ovrDeviceID ( )

Function Documentation

OVR_VRAPI_EXPORT ovrResult vrapi_EnumerateInputDevices ( ovrMobile * ovr, const uint32_t index, ovrInputCapabilityHeader * capsHeader )
Enumerates the input devices connected to the system Start with index=0 and counting up.
Stop when ovrResult is < 0
Input: ovrMobile, device index, and a capabilities header The capabilities header does not need to have any fields set before calling. Output: capabilitiesHeader with information for that enumeration index
OVR_VRAPI_EXPORT ovrResult vrapi_GetInputDeviceCapabilities ( ovrMobile * ovr, ovrInputCapabilityHeader * capsHeader )
Returns the capabilities of the input device for the corresponding device ID.
Input: ovr, pointer to a capabilities structure Output: capabilities will be filled with information for the deviceID Example: The Type field of the capabilitiesHeader must be set when calling this function. Normally the capabilitiesHeader is obtained from the vrapi_EnumerateInputDevices API The Type field in the header should match the structure type that is passed.
ovrInputCapabilityHeader capsHeader;
if ( vrapi_EnumerateInputDevices( ovr, deviceIndex, &capsHeader ) >= 0 ) {
    if ( capsHeader.Type == ovrDeviceType_TrackedRemote ) {
        ovrInputTrackedRemoteCapabilities remoteCaps;
        remoteCaps.Header = capsHeader;
        vrapi_GetInputDeviceCapabilities( ovr, &remoteCaps.Header );  
OVR_VRAPI_EXPORT ovrResult vrapi_GetCurrentInputState ( ovrMobile * ovr, const ovrDeviceID deviceID, ovrInputStateHeader * inputState )
Returns the current input state for controllers, without positional tracking info.
Input: ovr, deviceID, pointer to a capabilities structure (with Type field set) Output: Upon return the inputState structure will be set to the device's current input state Example: The Type field of the passed ovrInputStateHeader must be set to the type that corresponds to the type of structure being passed. The pointer to the ovrInputStateHeader should be a pointer to a Header field in structure matching the value of the Type field.
ovrInputStateTrackedRemote state; state.Header.Type = ovrControllerType_TrackedRemote; if ( vrapi_GetCurrentInputState( ovr, remoteDeviceID, &state.Header ) >= 0 ) {
OVR_VRAPI_EXPORT ovrResult vrapi_GetInputTrackingState ( ovrMobile * ovr, const ovrDeviceID deviceID, const double absTimeInSeconds, ovrTracking * tracking )
Returns the predicted input state based on the specified absolute system time in seconds.
Pass absTime value of 0.0 to request the most recent sensor reading. Input: ovr, device ID, prediction time Output: ovrTracking structure containing the device's predicted tracking state.
OVR_VRAPI_DEPRECATED ( void vrapi_RecenterInputPose )
Can be called from any thread while in VR mode.
Recenters the tracked remote to the current yaw of the headset. Input: ovr, device ID Output: None
OVR_VRAPI_EXPORT ovrResult vrapi_SetRemoteEmulation ( ovrMobile * ovr, const bool emulationOn )
Enable or disable emulation for the GearVR Controller.
Emulation is false by default. If emulationOn == true, then the back button and touch events on the GearVR Controller will be sent through the Android dispatchKeyEvent and dispatchTouchEvent path as if they were from the headset back button and touchpad. Applications that are intentionally enumerating the controller will likely want to turn emulation off in order to differentiate between controller and headset input events.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
78
79
80
81
83
84
85
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
107
108
109
110
112
113
115
116
119
120
121
123
124
125
127
128
129
130
131
132
133
134
135
146
147
148
149
151
152
154
155
158
159
160
162
163
164
165
167
168
169
170
172
173
175
176
177
178
179
180
181
184
185
187
188
190
191
192
196
197
198
199
201
202
205
206
208
209
211
214
216
217
219
220
222
223
224
225
226
231
232
233
234
236
237
240
241
243
244
245
247
248
249
250
252
253
254
255
256
257
258
260
262
263
264
265
266
267
268
269
270
271
278
279
295
296
297
311
312
313
318
319
320
324
325
332
333
334
335
336
337
338
339
/************************************************************************************

Filename    :   VrApi_Input.h
Content     :   Input API
Created     :   Feb 9, 2016
Authors     :   Jonathan E. Wright
Language    :   C99

Copyright   :   Copyright 2015 Oculus VR, LLC. All Rights reserved.

*************************************************************************************/
#ifndef OVR_VrApi_Input_h
#define OVR_VrApi_Input_h


#include <stddef.h>
#include <stdint.h>
#include "VrApi_Config.h"
#include "VrApi_Types.h"

typedefenum ovrButton_
{
    ovrButton_A         = 0x00000001,   // Set for trigger pulled on the Gear VR and Go Controllers
    ovrButton_B         = 0x00000002,
    ovrButton_RThumb    = 0x00000004,
    ovrButton_RShoulder = 0x00000008,

    ovrButton_X         = 0x00000100,
    ovrButton_Y         = 0x00000200,
    ovrButton_LThumb    = 0x00000400,
    ovrButton_LShoulder = 0x00000800,

    ovrButton_Up        = 0x00010000,
    ovrButton_Down      = 0x00020000,
    ovrButton_Left      = 0x00040000,
    ovrButton_Right     = 0x00080000,
    ovrButton_Enter     = 0x00100000,   //< Set for touchpad click on the Gear VR and Go Controllers
    ovrButton_Back      = 0x00200000,   //< Back button on the headset or Gear VR Controller (only set when a short press comes up)

    ovrButton_EnumSize  = 0x7fffffff
} ovrButton;



typedefenum ovrControllerType_
{
    ovrControllerType_None          = 0,
    ovrControllerType_Reserved0     = ( 1 << 0 ),   //< LTouch in CAPI
    ovrControllerType_Reserved1     = ( 1 << 1 ),   //< RTouch in CAPI
    ovrControllerType_TrackedRemote = ( 1 << 2 ),
    ovrControllerType_Headset       = ( 1 << 3 ),
    ovrControllerType_Gamepad       = ( 1 << 4 ),   //< Xbox in CAPI

    ovrControllerType_EnumSize      = 0x7fffffff
} ovrControllerType;

typedef uint32_t ovrDeviceID;

typedefenum ovrDeviceIdType_
{
    ovrDeviceIdType_Invalid = 0x7fffffff
} ovrDeviceIdType;

typedefstruct ovrInputCapabilityHeader_
{
    ovrControllerType   Type;

    ovrDeviceID         DeviceID;
} ovrInputCapabilityHeader;

typedefenum ovrControllerCapabilities_
{
    ovrControllerCaps_HasOrientationTracking        = 0x00000001,
    ovrControllerCaps_HasPositionTracking           = 0x00000002,
    ovrControllerCaps_LeftHand                      = 0x00000004,   //< Controller is configured for left hand
    ovrControllerCaps_RightHand                     = 0x00000008,   //< Controller is configured for right hand

    ovrControllerCaps_ModelOculusGo                 = 0x00000010,   //< Controller for Oculus Go devices


    ovrControllerCaps_ModelGearVR                   = 0x00000800,   // Controller is the Gear VR Controller

    ovrControllerCaps_HasTrackpad                   = 0x00001000,   // controller has a trackpad


    ovrControllerCaps_EnumSize                  = 0x7fffffff
} ovrControllerCapabilties;

typedefstruct ovrInputTrackedRemoteCapabilities_
{
    ovrInputCapabilityHeader    Header;

    uint32_t                    ControllerCapabilities;

    uint32_t                    ButtonCapabilities;

    uint16_t                    TrackpadMaxX;
    uint16_t                    TrackpadMaxY;

float                       TrackpadSizeX;
float                       TrackpadSizeY;

struct {
            uint32_t Reserved1;
            uint32_t Reserved2;
            uint32_t Reserved3;
            uint32_t Reserved4;
            uint32_t Reserved5;
        };
} ovrInputTrackedRemoteCapabilities;

typedefstruct ovrInputHeadsetCapabilities_
{
    ovrInputCapabilityHeader    Header;

    uint32_t                    ControllerCapabilities;

    uint32_t                    ButtonCapabilities;

    uint16_t                    TrackpadMaxX;
    uint16_t                    TrackpadMaxY;

float                       TrackpadSizeX;
float                       TrackpadSizeY;
} ovrInputHeadsetCapabilities;

typedefstruct ovrInputGamepadCapabilities_
{
    ovrInputCapabilityHeader    Header;

    uint32_t                    ControllerCapabilities;

    uint32_t                    ButtonCapabilities;

// Reserved for future use.
    uint64_t            Reserved[20];
} ovrInputGamepadCapabilities;


typedefstruct ovrInputStateHeader_
{
    ovrControllerType   ControllerType;

double              TimeInSeconds;
} ovrInputStateHeader;

typedefstruct ovrInputStateTrackedRemote_
{
    ovrInputStateHeader Header;

    uint32_t            Buttons;

    uint32_t            TrackpadStatus;

    ovrVector2f         TrackpadPosition;

    uint8_t             BatteryPercentRemaining;    
    uint8_t             RecenterCount;              
    uint16_t            Reserved;

struct { float Reserved2; float Reserved3; };

struct { uint32_t Reserved4; uint32_t Reserved5; ovrVector2f Reserved6; ovrVector2f Reserved7; };

} ovrInputStateTrackedRemote;


typedefstruct ovrInputStateHeadset_
{
    ovrInputStateHeader Header;

    uint32_t            Buttons;

    uint32_t            TrackpadStatus;

    ovrVector2f         TrackpadPosition;
} ovrInputStateHeadset;

typedefstruct ovrInputStateGamepad_
{
    ovrInputStateHeader Header;

    uint32_t            Buttons;

// Analog value from 0.0 - 1.0 of the pull of the Left Trigger
float               LeftTrigger;
// Analog value from 0.0 - 1.0 of the pull of the Right Trigger
float               RightTrigger;

    ovrVector2f         LeftJoyStick;
    ovrVector2f         RightJoyStick;

// Reserved for future use.
    uint64_t            Reserved[20];
} ovrInputStateGamepad;

#if defined( __cplusplus )
extern"C" {
#endif

OVR_VRAPI_EXPORT ovrResult vrapi_EnumerateInputDevices( ovrMobile * ovr, const uint32_t index, ovrInputCapabilityHeader * capsHeader );

OVR_VRAPI_EXPORT ovrResult vrapi_GetInputDeviceCapabilities( ovrMobile * ovr, ovrInputCapabilityHeader * capsHeader );


OVR_VRAPI_EXPORT ovrResult vrapi_GetCurrentInputState( ovrMobile * ovr, const ovrDeviceID deviceID, ovrInputStateHeader * inputState );


OVR_VRAPI_EXPORT ovrResult vrapi_GetInputTrackingState( ovrMobile * ovr, const ovrDeviceID deviceID, 
constdouble absTimeInSeconds, ovrTracking * tracking );

OVR_VRAPI_DEPRECATED( OVR_VRAPI_EXPORT void vrapi_RecenterInputPose( ovrMobile * ovr, const ovrDeviceID deviceID ) );

OVR_VRAPI_EXPORT ovrResult vrapi_SetRemoteEmulation( ovrMobile * ovr, constbool emulationOn );

#if defined( __cplusplus )
}   // extern "C"
#endif


#endif  // OVR_VrApi_Input_h
The documentation for this file was generated from the following file: Include/VrApi_Input.h