openvr icon indicating copy to clipboard operation
openvr copied to clipboard

ShouldBlockStandbyMode() { return true; } Not Working

Open kbigdelysh opened this issue 6 years ago • 4 comments

In the openvr_drive.h, there is this method: /** Returns true if the driver wants to block Standby mode. */ virtual bool ShouldBlockStandbyMode() = 0;

I used virtual bool ShouldBlockStandbyMode() { return true; } to tell the OpenVR not to set my custom driver in standby mode but it seems it's ineffective. It still changes the icons on the vr dashboard to standby status.

kbigdelysh avatar May 08 '19 22:05 kbigdelysh

Make sure you do not use the "virtual" keyboard in your implementation. Your implementation should be

bool ShouldBlockStandbyMode() { return true; }

not

virtual bool ShouldBlockStandbyMode() { return true; }

peroht avatar May 09 '19 09:05 peroht

Make sure you do not use the "virtual" keyboard in your implementation. Your implementation should be

bool ShouldBlockStandbyMode() { return true; }

not

virtual bool ShouldBlockStandbyMode() { return true; }

I remove the virtual but still no success. SteamVR still shows my custom drivers icons in the compositor in standby mode.

By the way, 'virtual' keyword (in C++) is still valid to use when you're implementing a virtual method from the base class.

kbigdelysh avatar Jun 14 '19 20:06 kbigdelysh

I like having virtual in the subclasses to make it clearer what's going on. I would suggest adding override if your compiler can handle C++11.

Let me answer your actual question though: That function is never called. Some guy named Joe removed the call in 2016 with this comment:

  • Stopped using "should block standby" functions. I'll remove these in a future checkin.

So maybe I should actually go remove them from the interface. :)

There's no way to keep SteamVR from calling EnterStandby/LeaveStandby, but you can always just do nothing in those functions and use the same icon for Standby mode that you use for Ready.

JoeLudwig avatar Jun 14 '19 20:06 JoeLudwig

polite cough https://github.com/ValveSoftware/openvr/blob/v1.16.8/headers/openvr_driver.h#L2929 polite cough

iesser avatar Aug 13 '21 08:08 iesser