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

Mobile 1.22 Reference Guide

VrApi_Input_CAPI_Shim.h File Reference

See Also:

Enumerations

enum
ovrButton {
ovrButton.ovrButton_A = 0x00000001, ovrButton.ovrButton_B = 0x00000002, ovrButton.ovrButton_RThumb = 0x00000004, ovrButton.ovrButton_RShoulder = 0x00000008, ovrButton.ovrButton_X = 0x00000100, ovrButton.ovrButton_Y = 0x00000200, ovrButton.ovrButton_LThumb = 0x00000400, ovrButton.ovrButton_LShoulder = 0x00000800, ovrButton.ovrButton_Up = 0x00010000, ovrButton.ovrButton_Down = 0x00020000, ovrButton.ovrButton_Left = 0x00040000, ovrButton.ovrButton_Right = 0x00080000, ovrButton.ovrButton_Enter = 0x00100000, ovrButton.ovrButton_Back = 0x00200000, ovrButton.ovrButton_GripTrigger = 0x04000000, ovrButton.ovrButton_Trigger = 0x20000000, ovrButton.ovrButton_Joystick = 0x80000000, ovrButton.ovrButton_EnumSize = 0x7fffffff, ovrButton.ovrButton_A = 0x00000001, ovrButton.ovrButton_B = 0x00000002, ovrButton.ovrButton_RThumb = 0x00000004, ovrButton.ovrButton_RShoulder = 0x00000008, ovrButton.ovrButton_X = 0x00000100, ovrButton.ovrButton_Y = 0x00000200, ovrButton.ovrButton_LThumb = 0x00000400, ovrButton.ovrButton_LShoulder = 0x00000800, ovrButton.ovrButton_Up = 0x00010000, ovrButton.ovrButton_Down = 0x00020000, ovrButton.ovrButton_Left = 0x00040000, ovrButton.ovrButton_Right = 0x00080000, ovrButton.ovrButton_Enter = 0x00100000, ovrButton.ovrButton_Back = 0x00200000, ovrButton.ovrButton_VolUp = 0x00400000, ovrButton.ovrButton_VolDown = 0x00800000, ovrButton.ovrButton_Home = 0x01000000, ovrButton.ovrButton_Private = ovrButton_VolUp | ovrButton_VolDown | ovrButton_Home, ovrButton.ovrButton_RMask = ovrButton_A | ovrButton_B | ovrButton_RThumb | ovrButton_RShoulder, ovrButton.ovrButton_LMask = ovrButton_X | ovrButton_Y | ovrButton_LThumb | ovrButton_LShoulder | ovrButton_Enter, ovrButton.ovrButton_EnumSize = 0x7fffffff
}
Describes button input types.
enum
ovrTouch {
ovrTouch.ovrTouch_A = 0x00000001, ovrTouch.ovrTouch_B = 0x00000002, ovrTouch.ovrTouch_X = 0x00000004, ovrTouch.ovrTouch_Y = 0x00000008, ovrTouch.ovrTouch_TrackPad = 0x00000010, ovrTouch.ovrTouch_Joystick = 0x00000020, ovrTouch.ovrTouch_IndexTrigger = 0x00000040, ovrTouch.ovrTouch_ThumbUp = 0x00000100, ovrTouch.ovrTouch_IndexPointing = 0x00000200, ovrTouch.ovrTouch_BaseState = 0x00000300, ovrTouch.ovrTouch_LThumb = 0x00000400, ovrTouch.ovrTouch_RThumb = 0x00000800, ovrTouch.ovrTouch_EnumSize , ovrTouch.ovrTouch_A = ovrButton_A, ovrTouch.ovrTouch_B = ovrButton_B, ovrTouch.ovrTouch_RThumb = ovrButton_RThumb, ovrTouch.ovrTouch_RThumbRest = 0x00000008, ovrTouch.ovrTouch_RIndexTrigger = 0x00000010, ovrTouch.ovrTouch_RButtonMask = ovrTouch_A | ovrTouch_B | ovrTouch_RThumb | ovrTouch_RThumbRest | ovrTouch_RIndexTrigger, ovrTouch.ovrTouch_X = ovrButton_X, ovrTouch.ovrTouch_Y = ovrButton_Y, ovrTouch.ovrTouch_LThumb = ovrButton_LThumb, ovrTouch.ovrTouch_LThumbRest = 0x00000800, ovrTouch.ovrTouch_LIndexTrigger = 0x00001000, ovrTouch.ovrTouch_LButtonMask = ovrTouch_X | ovrTouch_Y | ovrTouch_LThumb | ovrTouch_LThumbRest | ovrTouch_LIndexTrigger, ovrTouch.ovrTouch_RIndexPointing = 0x00000020, ovrTouch.ovrTouch_RThumbUp = 0x00000040, ovrTouch.ovrTouch_LIndexPointing = 0x00002000, ovrTouch.ovrTouch_LThumbUp = 0x00004000, ovrTouch.ovrTouch_RPoseMask = ovrTouch_RIndexPointing | ovrTouch_RThumbUp, ovrTouch.ovrTouch_LPoseMask = ovrTouch_LIndexPointing | ovrTouch_LThumbUp, ovrTouch.ovrTouch_EnumSize
}
Describes touch input types.
enum
ovrControllerType {
ovrControllerType.ovrControllerType_None = 0, ovrControllerType.ovrControllerType_Reserved0 = ( 1 << 0 ), ovrControllerType.ovrControllerType_Reserved1 = ( 1 << 1 ), ovrControllerType.ovrControllerType_TrackedRemote = ( 1 << 2 ), ovrControllerType.ovrControllerType_Headset = ( 1 << 3 ), ovrControllerType.ovrControllerType_Gamepad = ( 1 << 4 ), ovrControllerType.ovrControllerType_EnumSize = 0x7fffffff, ovrControllerType.ovrControllerType_None = 0x00, ovrControllerType.ovrControllerType_LTouch = 0x01, ovrControllerType.ovrControllerType_RTouch = 0x02, ovrControllerType.ovrControllerType_Touch = 0x03, ovrControllerType.ovrControllerType_Remote = 0x04, ovrControllerType.ovrControllerType_Headset = 0x08, ovrControllerType.ovrControllerType_XBox = 0x10, ovrControllerType.ovrControllerType_Active = 0xff, ovrControllerType.ovrControllerType_EnumSize = 0x7fffffff
}
Specifies which controller is connected; multiple can be connected at once.
enum
ovrHandType {
}
Provides names for the left and right hand array indexes.
enum
ovrDeviceIdType {
}

Typedefs

uint32_t

Functions

ovrResult
vrapi_GetInputState ( ovrControllerType controllerType, ovrInputState * inputState )
Returns the most recent input state for controllers, without positional tracking info.
unsigned int
Returns controller types connected to the system OR'ed together.
ovrResult
vrapi_SetControllerVibration ( ovrControllerType controllerType, float frequency, float amplitude )
Turns on vibration of the given controller.

Enumeration Type Documentation

enum VrApi_Input_CAPI_Shim.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_GripTrigger= 0x04000000
ovrButton_Trigger= 0x20000000
ovrButton_Joystick= 0x80000000
ovrButton_EnumSize= 0x7fffffff
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_VolUp= 0x00400000
ovrButton_VolDown= 0x00800000
ovrButton_Home= 0x01000000
ovrButton_Private
Bit mask of all buttons that are for private usage by Oculus.
ovrButton_RMask
Bit mask of all buttons on the right Touch controller.
ovrButton_LMask
Bit mask of all buttons on the left Touch controller.
ovrButton_EnumSize= 0x7fffffff
enum VrApi_Input_CAPI_Shim.h.ovrTouch
Describes touch input types.
Enumerator
ovrTouch_A= 0x00000001
ovrTouch_B= 0x00000002
ovrTouch_X= 0x00000004
ovrTouch_Y= 0x00000008
ovrTouch_TrackPad= 0x00000010
ovrTouch_Joystick= 0x00000020
ovrTouch_IndexTrigger= 0x00000040
ovrTouch_ThumbUp= 0x00000100
ovrTouch_IndexPointing= 0x00000200
ovrTouch_BaseState= 0x00000300
ovrTouch_LThumb= 0x00000400
ovrTouch_RThumb= 0x00000800
ovrTouch_EnumSize
ovrTouch_A= ovrButton_A
ovrTouch_B= ovrButton_B
ovrTouch_RThumb= ovrButton_RThumb
ovrTouch_RThumbRest= 0x00000008
ovrTouch_RIndexTrigger= 0x00000010
ovrTouch_RButtonMask
Bit mask of all the button touches on the right controller.
ovrTouch_X= ovrButton_X
ovrTouch_Y= ovrButton_Y
ovrTouch_LThumb= ovrButton_LThumb
ovrTouch_LThumbRest= 0x00000800
ovrTouch_LIndexTrigger= 0x00001000
ovrTouch_LButtonMask
Bit mask of all the button touches on the left controller.
ovrTouch_RIndexPointing
Finger pose state Derived internally based on distance, proximity to sensors and filtering.
ovrTouch_RThumbUp= 0x00000040
ovrTouch_LIndexPointing= 0x00002000
ovrTouch_LThumbUp= 0x00004000
ovrTouch_RPoseMask
Bit mask of all right controller poses.
ovrTouch_LPoseMask
Bit mask of all left controller poses.
ovrTouch_EnumSize
enum VrApi_Input_CAPI_Shim.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
ovrControllerType_None= 0x00
ovrControllerType_LTouch= 0x01
ovrControllerType_RTouch= 0x02
ovrControllerType_Touch= 0x03
ovrControllerType_Remote= 0x04
ovrControllerType_Headset= 0x08
ovrControllerType_XBox= 0x10
ovrControllerType_Active= 0xff
ovrControllerType_EnumSize= 0x7fffffff
enum VrApi_Input_CAPI_Shim.h.ovrHandType
Provides names for the left and right hand array indexes.
Enumerator
ovrHand_Left= 0
ovrHand_Right= 1
ovrHand_Count= 2
ovrHand_EnumSize= 0x7fffffff
enum VrApi_Input_CAPI_Shim.h.ovrDeviceIdType
Enumerator
ovrDeviceIdType_Invalid= 0x7fffffff
ovrDeviceIdType_Invalid= 0x7fffffff

Typedef Documentation

typedef uint32_t ovrDeviceID ( )

Function Documentation

OVR_VRAPI_ASSERT_TYPE_SIZE ( ovrInputState , 88 )
OVR_VRAPI_EXPORT ovrResult vrapi_GetInputState ( ovrControllerType controllerType, ovrInputState * inputState )
Returns the most recent input state for controllers, without positional tracking info.
OVR_VRAPI_EXPORT unsigned int vrapi_GetConnectedControllerTypes ( )
Returns controller types connected to the system OR'ed together.
OVR_VRAPI_EXPORT ovrResult vrapi_SetControllerVibration ( ovrControllerType controllerType, float frequency, float amplitude )
Turns on vibration of the given controller.
To disable vibration, call vrapi_SetControllerVibration with an amplitude of 0. Vibration automatically stops after a nominal amount of time, so if you want vibration to be continuous over multiple seconds then you need to call this function periodically.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
49
50
52
53
55
56
57
58
59
60
64
65
66
67
68
69
70
71
73
74
75
76
77
78
79
80
82
83
86
87
88
89
90
92
93
95
96
97
98
99
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
139
140
142
143
145
146
148
149
154
155
159
160
163
164
166
167
173
174
180
181
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
201
202
204
205
211
212
213
214
215
216
217
/************************************************************************************

Filename    :   VrApi_Input_CAPI_Shim.h
Content     :   Input API shim to keep windows building
Created     :   Feb 9, 2016
Authors     :   Jonathan E. Wright
Language    :   C99

Copyright   :   Copyright (c) Facebook Technologies, LLC and its affiliates. All rights reserved.

*************************************************************************************/
#ifndef OVR_VrApi_Input_Windows_CAPI_h
#define OVR_VrApi_Input_Windows_CAPI_h

// NOTE: Everything in this section should stay in sync with CAPI.

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

typedefenum ovrButton_
{
    ovrButton_A         = 0x00000001, //< A button on XBox controllers and right Touch controller. Select button on Oculus Remote.
    ovrButton_B         = 0x00000002, //< B button on XBox controllers and right Touch controller. Back button on Oculus Remote.
    ovrButton_RThumb    = 0x00000004, //< Right thumbstick on XBox controllers and Touch controllers. Not present on Oculus Remote.
    ovrButton_RShoulder = 0x00000008, //< Right shoulder button on XBox controllers. Not present on Touch controllers or Oculus Remote.

    ovrButton_X         = 0x00000100,  //< X button on XBox controllers and left Touch controller. Not present on Oculus Remote.
    ovrButton_Y         = 0x00000200,  //< Y button on XBox controllers and left Touch controller. Not present on Oculus Remote.
    ovrButton_LThumb    = 0x00000400,  //< Left thumbstick on XBox controllers and Touch controllers. Not present on Oculus Remote.
    ovrButton_LShoulder = 0x00000800,  //< Left shoulder button on XBox controllers. Not present on Touch controllers or Oculus Remote.

    ovrButton_Up        = 0x00010000,  //< Up button on XBox controllers and Oculus Remote. Not present on Touch controllers.
    ovrButton_Down      = 0x00020000,  //< Down button on XBox controllers and Oculus Remote. Not present on Touch controllers.
    ovrButton_Left      = 0x00040000,  //< Left button on XBox controllers and Oculus Remote. Not present on Touch controllers.
    ovrButton_Right     = 0x00080000,  //< Right button on XBox controllers and Oculus Remote. Not present on Touch controllers.
    ovrButton_Enter     = 0x00100000,  //< Start on XBox 360 controller. Menu on XBox One controller and Left Touch controller. Should be referred to as the Menu button in user-facing documentation.
    ovrButton_Back      = 0x00200000,  //< Back on Xbox 360 controller. View button on XBox One controller. Not present on Touch controllers or Oculus Remote.
    ovrButton_VolUp     = 0x00400000,  //< Volume button on Oculus Remote. Not present on XBox or Touch controllers.
    ovrButton_VolDown   = 0x00800000,  //< Volume button on Oculus Remote. Not present on XBox or Touch controllers.
    ovrButton_Home      = 0x01000000,  //< Home button on XBox controllers. Oculus button on Touch controllers and Oculus Remote.

    ovrButton_Private   = ovrButton_VolUp | ovrButton_VolDown | ovrButton_Home,

    ovrButton_RMask = ovrButton_A | ovrButton_B | ovrButton_RThumb | ovrButton_RShoulder,

    ovrButton_LMask = ovrButton_X | ovrButton_Y | ovrButton_LThumb | ovrButton_LShoulder |
                        ovrButton_Enter,

    ovrButton_EnumSize  = 0x7fffffff
} ovrButton;

typedefenum ovrTouch_
{
    ovrTouch_A              = ovrButton_A,
    ovrTouch_B              = ovrButton_B,
    ovrTouch_RThumb         = ovrButton_RThumb,
    ovrTouch_RThumbRest     = 0x00000008,
    ovrTouch_RIndexTrigger  = 0x00000010,

    ovrTouch_RButtonMask    = ovrTouch_A | ovrTouch_B | ovrTouch_RThumb | ovrTouch_RThumbRest | ovrTouch_RIndexTrigger,

    ovrTouch_X              = ovrButton_X,
    ovrTouch_Y              = ovrButton_Y,
    ovrTouch_LThumb         = ovrButton_LThumb,
    ovrTouch_LThumbRest     = 0x00000800,
    ovrTouch_LIndexTrigger  = 0x00001000,

    ovrTouch_LButtonMask    = ovrTouch_X | ovrTouch_Y | ovrTouch_LThumb | ovrTouch_LThumbRest | ovrTouch_LIndexTrigger,

    ovrTouch_RIndexPointing = 0x00000020,
    ovrTouch_RThumbUp       = 0x00000040,
    ovrTouch_LIndexPointing = 0x00002000,
    ovrTouch_LThumbUp       = 0x00004000,

    ovrTouch_RPoseMask      = ovrTouch_RIndexPointing | ovrTouch_RThumbUp,

    ovrTouch_LPoseMask      = ovrTouch_LIndexPointing | ovrTouch_LThumbUp,

    ovrTouch_EnumSize
} ovrTouch;

typedefenum ovrControllerType_
{
    ovrControllerType_None      = 0x00,
    ovrControllerType_LTouch    = 0x01,
    ovrControllerType_RTouch    = 0x02,
    ovrControllerType_Touch     = 0x03,
    ovrControllerType_Remote    = 0x04,
#if 1 // NOTE: This is not part of CAPI and is only added to ease porting.
    ovrControllerType_Headset   = 0x08,
#endif
    ovrControllerType_XBox      = 0x10,

    ovrControllerType_Active    = 0xff,      //< Operate on or query whichever controller is active.

    ovrControllerType_EnumSize  = 0x7fffffff
} ovrControllerType;

typedefenum ovrHandType_
{
    ovrHand_Left  = 0,
    ovrHand_Right = 1,
    ovrHand_Count = 2,
    ovrHand_EnumSize = 0x7fffffff
} ovrHandType;

#if 1 // NOTE: This is not part of CAPI and is only added to ease porting.
typedef uint32_t ovrDeviceID;
#endif

typedefenum ovrDeviceIdType_
{
    ovrDeviceIdType_Invalid     = 0x7fffffff
} ovrDeviceIdType;

typedefstruct ovrInputState_
{
double              TimeInSeconds;

unsignedint        Buttons;

unsignedint        Touches;

float               IndexTrigger[ovrHand_Count];

float               HandTrigger[ovrHand_Count];

    ovrVector2f         Thumbstick[ovrHand_Count];

    ovrControllerType   ControllerType;

float               IndexTriggerNoDeadzone[ovrHand_Count];

float               HandTriggerNoDeadzone[ovrHand_Count];

    ovrVector2f         ThumbstickNoDeadzone[ovrHand_Count];

    OVR_VRAPI_PADDING( 4 );
} ovrInputState;

OVR_VRAPI_ASSERT_TYPE_SIZE( ovrInputState, 88 );

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

//-----------------------------------------------------------------
// Input - Currently only supported for PC
//-----------------------------------------------------------------

OVR_VRAPI_EXPORT ovrResult vrapi_GetInputState( ovrControllerType controllerType, ovrInputState * inputState );

OVR_VRAPI_EXPORT unsignedint vrapi_GetConnectedControllerTypes();

OVR_VRAPI_EXPORT ovrResult vrapi_SetControllerVibration( ovrControllerType controllerType, float frequency, float amplitude );

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

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