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
| uint32_t | ovrDeviceID ( ) |
/************************************************************************************
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