DrBibop / RoR2VRMod

https://thunderstore.io/package/DrBibop/VRMod/
MIT License
51 stars 7 forks source link

Game goes "out of focus" when using the left trigger #68

Closed LoganDark closed 11 months ago

LoganDark commented 11 months ago

I'm using the VRMod through Windows Mixed Reality and SteamVR.

Clicking the left trigger (not any of the other buttons) causes the game to go "out of focus" and killed my run because I couldn't find my mouse while in virtual reality.

This issue is bad enough that I just completely can't use the mod until it's fixed. It shouldn't ever tell me that the game is out of focus while I'm in VR. Put it in focus for me. It's completely unacceptable to expect someone to be able to operate their computer while they're in VR or in the middle of a VR run

DrBibop commented 11 months ago

As far as Im aware, I can’t force focus onto Risk of Rain. I’ve tried to make inputs work while out of focus in the past to no avail.

I’m unsure what’s causing the left trigger to unfocus the game. Are you using some sort of app that uses the left trigger for some other action or something?

LoganDark commented 11 months ago

Are you using some sort of app that uses the left trigger for some other action or something?

I'm not sure. WMR uses some weird thing (toggled with Windows+Y) that somehow decides if inputs "go to the desktop" or not. I don't know what exact setup works, but if I set inputs to go to the headset, and then manually select the window with a physical mouse, then inputs (except for the left trigger) will work.

(I'm using a HP Reverb G2, so WMR is not optional. I'm running Windows 11 Enterprise 23H2.)

If I do anything else (i.e. try to select the game using the SteamVR desktop view, or use anything other than a physical mouse), then the game might technically be focused, but any trigger press will unfocus the game.

So I literally can't do anything except use a physical mouse to focus the game, and then I can't ever press the left trigger, or else the game unfocuses.

DrBibop commented 11 months ago

This is the first time I’m hearing about this tbh. I can ask another WMR users if they know anything because I don’t think there’s much I can do about it. I’ll update you on that.

DrBibop commented 11 months ago

My friend who uses a Reverb G2 said they never encountered that issue when playing the mod. Since I've never seen anyone else talk about it, I'm assuming this is probably an issue on your end.

I did find that it is possible to set the game window as focused, but it is definitively not a feature in Unity. It's rather a finicky workaround using system calls so I'm not really sure if I should dive into that.

There seems to be similar "focus" issues with WMR that people have reported online (not related to RoR2). Maybe you could find a solution in one of these forums. I'm sorry I couldn't be of more help, but do let me know if you find anything that helps in case someone else has the same issue.

LoganDark commented 11 months ago

It's rather a finicky workaround using system calls so I'm not really sure if I should dive into that.

Is it possible to attempt it to at least see if it fixes my issue? I'm really not sure what could even be causing it on my end - I don't have any software that intercepts VR inputs, and I started the game through r2modman's "Start Modded" button, nothing non-standard there. I'll try again later, but I can't really find anything wrong with my computer right now.

DrBibop commented 11 months ago

I guess I could give it a try, but I wonder if the left trigger will actually fire since it causes the focus issue. At the end of the day, there's only one way to find out. Add me on Discord (drbibop) and I'll send you a build for you to try once I get to it.

DrBibop commented 11 months ago

Closing since it's a 3rd party issue

LoganDark commented 11 months ago

Oops, forgot to update. Yeah, it turned out to be a SteamVR issue where it won't handle focus properly until I've opened a UAC prompt at least once (while in VR mode). It's annoying because it requires me to mess with a physical keyboard in order to dismiss the prompt, but it doesn't matter if it is approved or denied - the switch to the secure desktop (and back) is all that's needed.