Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openvr_capi.h missing newer VREvent_Data_t fields #39

Open
lukexi opened this issue Dec 2, 2015 · 3 comments
Open

openvr_capi.h missing newer VREvent_Data_t fields #39

lukexi opened this issue Dec 2, 2015 · 3 comments

Comments

@lukexi
Copy link

lukexi commented Dec 2, 2015

openvr_capi.h is missing 6 of the newer fields in VREvent_Data_t from openvr.h:

https://github.com/ValveSoftware/openvr/blob/master/headers/openvr_capi.h#L71

typedef union
{
    VREvent_Reserved_t reserved;
    VREvent_Controller_t controller;
    VREvent_Mouse_t mouse;
    VREvent_Process_t process;
} VREvent_Data_t;

Versus the version in openvr.h
https://github.com/ValveSoftware/openvr/blob/master/headers/openvr.h#L509

typedef union
{
    VREvent_Reserved_t reserved;
    VREvent_Controller_t controller;
    VREvent_Mouse_t mouse;
    VREvent_Process_t process;
    VREvent_Notification_t notification;
    VREvent_Overlay_t overlay;
    VREvent_Status_t status;
    VREvent_Keyboard_t keyboard;
    VREvent_Ipd_t ipd;
    VREvent_Chaperone_t chaperone;
} VREvent_Data_t;

See also #31 — the VREvent_t type is missing entirely in openvr_capi.h

Thanks!

@lukexi
Copy link
Author

lukexi commented Dec 2, 2015

Ah, and we're also missing the associated VREvent_Notification_t, VREvent_Overlay_t, VREvent_Status_t, VREvent_Keyboard_t, VREvent_Ipd_t and VREvent_Chaperone_t types.

@ChristophHaag
Copy link

In 2018 this is still an issue.

I was scratching my head why I was getting garbage data from the events until I compared:

openvr/headers/openvr_capi.h

Lines 1970 to 1986 in 6aacebd

typedef union
{
VREvent_Reserved_t reserved;
VREvent_Controller_t controller;
VREvent_Mouse_t mouse;
VREvent_Scroll_t scroll;
VREvent_Process_t process;
VREvent_Notification_t notification;
VREvent_Overlay_t overlay;
VREvent_Status_t status;
VREvent_Keyboard_t keyboard;
VREvent_Ipd_t ipd;
VREvent_Chaperone_t chaperone;
VREvent_PerformanceTest_t performanceTest;
VREvent_TouchPadMove_t touchPadMove;
VREvent_SeatedZeroPoseReset_t seatedZeroPoseReset;
} VREvent_Data_t;

openvr/headers/openvr.h

Lines 1012 to 1041 in 6aacebd

typedef union
{
VREvent_Reserved_t reserved;
VREvent_Controller_t controller;
VREvent_Mouse_t mouse;
VREvent_Scroll_t scroll;
VREvent_Process_t process;
VREvent_Notification_t notification;
VREvent_Overlay_t overlay;
VREvent_Status_t status;
VREvent_Keyboard_t keyboard;
VREvent_Ipd_t ipd;
VREvent_Chaperone_t chaperone;
VREvent_PerformanceTest_t performanceTest;
VREvent_TouchPadMove_t touchPadMove;
VREvent_SeatedZeroPoseReset_t seatedZeroPoseReset;
VREvent_Screenshot_t screenshot;
VREvent_ScreenshotProgress_t screenshotProgress;
VREvent_ApplicationLaunch_t applicationLaunch;
VREvent_EditingCameraSurface_t cameraSurface;
VREvent_MessageOverlay_t messageOverlay;
VREvent_Property_t property;
VREvent_DualAnalog_t dualAnalog;
VREvent_HapticVibration_t hapticVibration;
VREvent_WebConsole_t webConsole;
VREvent_InputBindingLoad_t inputBinding;
VREvent_InputActionManifestLoad_t actionManifest;
VREvent_SpatialAnchor_t spatialAnchor;
/** NOTE!!! If you change this you MUST manually update openvr_interop.cs.py */
} VREvent_Data_t;

replacing the union in openvr_capi.h with the one in openvr.h makes events work. Thanks, lukexi for documenting this issue.

@ChristophHaag
Copy link

Unrelated to this issue but the actual fix for my issue was not the union, but if anyone else stumbles here: the pragma below that I also copied over in my test was the actual fix for my issue.

openvr/headers/openvr.h

Lines 1044 to 1048 in 6aacebd

#if defined(__linux__) || defined(__APPLE__)
// This structure was originally defined mis-packed on Linux, preserved for
// compatibility.
#pragma pack( push, 4 )
#endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants