marcob Posted November 24, 2020 Share Posted November 24, 2020 That is my code, I'm using example setup for clicking emulation void MyDevice::startEmulation() { joystickX = 0; joystickY = 0; trackpadX = 0; trackpadY = 0; std::thread thread_object([](void* device) { MyDevice* myDevice = (MyDevice*)device; for (;;) { myDevice->joystickX = 0.95; myDevice->joystickY = 0.95; std::this_thread::sleep_for(std::chrono::seconds(1)); myDevice->joystickX = 0; myDevice->joystickY = 0; std::this_thread::sleep_for(std::chrono::seconds(1)); } ; }, this ); } That's where is it calling EVRInitError MyDeviceProvider::Init(IVRDriverContext* pDriverContext) { EVRInitError initError = InitServerDriverContext(pDriverContext); if (initError != EVRInitError::VRInitError_None) { return initError; } VRDriverLog()->Log("Initializing Finally Functional's VR Shoes"); controllerDriver = new MyDevice(); controllerDriver->startEmulation(); VRServerDriverHost()->TrackedDeviceAdded("teensyDriver", TrackedDeviceClass_Controller, controllerDriver); return vr::VRInitError_None; } Is it good idea to use threading in openVR applications? @chengnay Link to comment Share on other sites More sharing options...
chengnay Posted November 26, 2020 Share Posted November 26, 2020 @marcob Did you try your code yet? Will it work? I did not try threading to simulate the click event. Are you testing this in Unity? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now