Remove option forcing bindings to show up in SteamVR

Overlay applications show up in the bindings menu after SteamVR beta
1.3.1, making these features unnecessary.
This commit is contained in:
Vasily
2019-03-10 23:12:26 +01:00
committed by username223
parent 84be2090c8
commit 5d2901be33
6 changed files with 1 additions and 77 deletions
+1 -9
View File
@@ -81,13 +81,7 @@ To upgrade an existing installation first stop SteamVR and delete the old applic
<a name="bindings"></a>
## Bindings
Advanced Settings supports the OpenVR IVRInput API. In order to make the bindings interface visible, change the `matzman666.AdvancedSettings.vrappconfig` in `C:\Program Files (x86)\Steam\config\vrappconfig` to have a `last_launch_time` close to the current date (in [Unix time](https://en.wikipedia.org/wiki/Unix_time)). If in doubt, try using the value from [this](https://time.is/Unix_time_now) site. Running the application normally will now make it show up in the bindings interface.
Alternatively, if the above doesn't work, run the `bindingsinterface.bat` file from the install directory. After you're done configuring your bindings, close SteamVR and start it up again. You are now using your new bindings. Advanced Settings will not show up in the bindings menu unless you're actively running the application with `bindingsinterface.bat`. Advanced Settings will not work normally while running with `bindingsinterface.bat`.
The above two solutions are workarounds to a bug in the OpenVR API.
After doing one of the above workarounds, when SteamVR starts click the menu -> Settings -> Controller Binding. You can also visit [this](127.0.0.1:8998/dashboard/controllerbinding.html) site in your internet browser. It's the same as the built in SteamVR bindings menu. SteamVR must be running for it to work.
After SteamVR beta 1.3.1 the bindings for Advanced Settings will show up in the bindings menu.
By default no buttons are bound.
@@ -116,8 +110,6 @@ The application (`AdvancedSettings.exe`) can be run with the following optional
`"-removemanifest"`: Force uninstalls the `.vrmanifest`. This should be done every time the application is uninstalled. On Windows it is automatically done by the uninstaller. The program will exit early when this flag is set.
`"-bindingsinterface"`: Makes Advanced Settings show up in the SteamVR bindings interface. This is necessary for binding keys to actions. This is the same as running `bindingsinterface.bat` from the executable directory. The program will not exit when this is set. No normal functionality is available except using the bindings interface. Bindings set with this active will be available when this isn't active.
In addition, the application can receive the command line arguments from the [Easylogging++ library](https://github.com/zuhd-org/easyloggingpp#application-arguments).
<a name="logging_config"></a>
-11
View File
@@ -16,8 +16,6 @@ int main( int argc, char* argv[] )
argc, argv, argument::kInstallManifest );
const bool removeManifest = argument::CheckCommandLineArgument(
argc, argv, argument::kRemoveManifest );
const bool bindingsInterface = argument::CheckCommandLineArgument(
argc, argv, argument::kEnableBindingsInterface );
// If a command line arg is set, make sure the logs reflect that.
LOG_IF( desktopMode, INFO ) << "Desktop mode enabled.";
@@ -25,15 +23,6 @@ int main( int argc, char* argv[] )
LOG_IF( noManifest, INFO ) << "vrmanifest disabled.";
LOG_IF( installManifest, INFO ) << "Install manifest enabled.";
LOG_IF( removeManifest, INFO ) << "Remove manifest enabled.";
LOG_IF( bindingsInterface, INFO ) << "Bindings interface enabled.";
if ( bindingsInterface )
{
// This is a temporary solution until Valve fixes overlays not
// showing up in the bindings interface. See function description for
// more info.
openvr_init::openBindingsMenu();
}
// It is important that either install_manifest or remove_manifest are true,
// otherwise the handleManifests function will not behave properly.
-53
View File
@@ -31,59 +31,6 @@ void initializeProperly()
}
}
/*!
Initializes OpenVR to be in the bindings menu and then exits.
This is needed because all applications initialized with OpenVR that aren't of
type vr::VRApplication_Scene do not show up the in bindings menu.
This is obviously an ugly hack and should be done away with as soon as Valve
fixes this issue.
Official Issues for this:
https://github.com/ValveSoftware/openvr/issues/914
https://github.com/ValveSoftware/openvr/issues/926
https://github.com/ValveSoftware/openvr/issues/879
You can also make it appear by changing the
C:\Program Files (x86)\Steam\config\vrappconfig\*.vrappconfig file for your
project to have a "last_launch_time" of something greater than zero.
From experimentation it seems that there's a cutoff time around 2 weeks before
the current time. Setting it to the day before seems to be a good bet. (In unix
time).
*/
[[noreturn]] void openBindingsMenu()
{
// Prefix the logs with this to visibly document that this isn't how things
// are supposed to be. Hopefully someone reads the logs and comes here after
// Valve has fixed it.
constexpr auto logPrefix = "[HACK]::openBindingsMenu ";
auto initError = vr::VRInitError_None;
LOG( INFO ) << logPrefix << "Initializing application as scene.";
vr::VR_Init( &initError, vr::VRApplication_Scene );
if ( initError != vr::VRInitError_None )
{
LOG( ERROR ) << logPrefix << "Error initializing application as scene.";
exit( 2 );
}
else
{
LOG( INFO ) << logPrefix << "Application initialized as scene.";
}
// This needs to be initialized, otherwise the bindings won't show up in the
// menu.
input::Manifest manifest;
// SteamVR just needs a good enough time to start up comfortably and for the
// user to get into the bindings menu.
while ( true )
{
}
}
OpenVR_Init::OpenVR_Init()
{
initializeProperly();
-2
View File
@@ -2,8 +2,6 @@
namespace openvr_init
{
[[noreturn]] void openBindingsMenu();
/*!
Initializes OpenVR and checks validity of interface versions. Shuts down OpenVR
when destroyed.
-1
View File
@@ -1 +0,0 @@
start AdvancedSettings.exe -bindingsinterface
-1
View File
@@ -45,7 +45,6 @@ constexpr auto kNoSound = "-nosound";
constexpr auto kNoManifest = "-nomanifest";
constexpr auto kInstallManifest = "-installmanifest";
constexpr auto kRemoveManifest = "-removemanifest";
constexpr auto kEnableBindingsInterface = "-bindingsinterface";
} // namespace argument
namespace manifest