Hotrian / OpenVRDesktopDisplayPortal

Put your favorite Desktop Window directly into any OpenVR game!
Other
449 stars 96 forks source link

Feature request: Command line window selection #47

Closed greyson closed 7 years ago

greyson commented 8 years ago

(I don't know where to put feature requests, sorry if this is the wrong place.)

My use case: I would like to use VoiceAttack to start OVRDDP to bring in a particular window.

I'm currently researching how to get cmdline parameters in unity; if i can figure this out, I will submit a pull request; but I'm quite new to Unity.

Hotrian commented 8 years ago

Hmm. I haven't tried messing around with the command line + Unity before, though it looks to be doable.

Here is Unity's Built-In Command Line parameters though I'm not seeing anything useful here for that. However, it looks like you can use the System.Environment.Commandline class to grab the command line arguments. This is mentioned on Unity Answers here where a user recommends using + instead of - for custom arguments since Unity will ignore unknown commands and pass them along happily, and it will make it very easy to determine custom arguments from built-in ones.

As per the Unity Mono Compatibility Documentation it would seem System.Environment.Commandline is available in the .Net 2.0 and .Net 2.0 Subset though not on the web player, but of course OVRDDP is not designed to be a web player application anyway.

I'll see about adding this for 1.0.7, though OVRDDP works by grabbing the Process Id, which won't work for command line arguments because the PID changes each time an application is launched. What would work though is by grabbing it using the EXE name or the Window Title, but either could fail due to the fact an application can be launched twice, and can change its title. For example, most browsers change their title to match the current webpage, and some browsers can be launched multiple times or operate by using multiple EXE's, such as Chrome which runs itself in a separate EXE for each browser window.

This should work to also auto-load a certain profile, and I'm assuming it will be able to read the parameters for a shortcut as well, which means you should be able to create a number of shortcuts that would automatically target a certain application and automatically load a certain profile, which would be nice :).

Thanks for the suggestion!

Edit: Also, this is the correct place for Feature Requests on Github :).

Hotrian commented 7 years ago

This is now in OVRdrop, which is the closed source Steam Release of OVRDDP. Since I will continue to incorporate feature requests from OVRDDP into OVRdrop, I am closing this issue now.

If you are interested, you can find OVRdrop on Steam here.