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 ( ) |
| 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 | Enable or disable emulation for the GearVR Controller. |
ovrInputCapabilityHeader capsHeader;
if ( vrapi_EnumerateInputDevices( ovr, deviceIndex, &capsHeader ) >= 0 ) {
if ( capsHeader.Type == ovrDeviceType_TrackedRemote ) {
ovrInputTrackedRemoteCapabilities remoteCaps;
remoteCaps.Header = capsHeader;
vrapi_GetInputDeviceCapabilities( ovr, &remoteCaps.Header ); /************************************************************************************
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