Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Anonymous's avatar
Anonymous
7 years ago

ovr_GetInputState does not return data

Hello,
I am working with Oculus SDK C++ and have specific requirement to read only oculus sensor data.
i have separate thread initialize oculus in the beginning with:

ovrInitParams initParams = { ovrInit_RequestVersion, OVR_MINOR_VERSION, NULL, 0, 0 };

            ovrResult result = ovr_Initialize(&initParams);
            if (OVR_FAILURE(result))
                return false;

            result = ovr_Create(&session, &luid);
            if (OVR_FAILURE(result))
            {
                ovr_Shutdown();
                return false;
            }

and then in regular intervals I call

trackState = ovr_GetTrackingState(session, 0, ovrTrue);
bool success = OVR_SUCCESS(ovr_GetInputState(session, ovrControllerType_Touch, &inputState));

I get tracking state properly but inputState is always empty.
I am not getting any info from Buttons or joystick.

It is really minimum I need.

Please help.



4 Replies

  • Anonymous's avatar
    Anonymous
    Hello.
    Thanks for reply.
    1) i want to use touch controllers and input to control my device.
    2) I simply create it with CreateThread. I don't render any UI in Rift. Just use minimum code required.
  • I think that corresponds to https://forums.oculusvr.com/developer/discussion/66763/issue-with-version-1-27-and-sdk-v1-26 

    Since SDK 1.27 it is not possible to get inputstate without rendering. :-/

    That used to work before 1.27 and I used it successfully with FreePIE and vJoy. 
  • Hi, I just found this thread https://forums.oculusvr.com/developer/discussion/33329/has-oculus-removed-the-ability-to-run-c-console-exes

    There is a comment to initialize the ovr with the "Invisible" flag which I just tried:
    ovrInitParams initParams = { ovrInit_RequestVersion + ovrInit_Invisible, OVR_MINOR_VERSION, NULL, 0, 0 };
    ovrResult result = ovr_Initialize(&initParams);

    With this intitialization, the InputState structure gets updated without any rendering. Maybe this helps you too.

    Stefan
  • Anonymous's avatar
    Anonymous
    thank you. i will try this out!