Forum Discussion
sbdykes
10 years agoExpert Protege
1.3.0 and mouse focus
It appears to be the case that the new 1.3.0 runtime is doing something "interesting" with mouse focus/exclusivity, namely that it is somehow forcing the mouse cooperative mode to be foreground exclusive for the currently running VR app (global mouse cursor is gone until VR application loses focus). My project is specifically and intentionally NOT setting mouse exclusivity (at least when in its own dev mode).
Is anyone else getting this behavior?
I think I can understand the general reasoning behind this (prevent the user from inadvertently clicking on something with the headset on, which might make the VR app lose focus, etc.). However, I think this is really best left to the application itself, or at least as something you can switch off for dev purposes. It's not the end of the world, but it's an annoyance, and I could see how changing the system mouse behavior might cause issues for some applications not expecting it.
Is anyone else getting this behavior?
I think I can understand the general reasoning behind this (prevent the user from inadvertently clicking on something with the headset on, which might make the VR app lose focus, etc.). However, I think this is really best left to the application itself, or at least as something you can switch off for dev purposes. It's not the end of the world, but it's an annoyance, and I could see how changing the system mouse behavior might cause issues for some applications not expecting it.
13 Replies
- cyberealityGrand ChampionMouse control is not recommended or fully supported currently in VR applications. If you are working on an app, you should aim to have it functioning with Xbox gamepad controls primarily (or Oculus Remote).
- galopinHeroic ExplorerWhy it would not be fully supported ? i understand it may not be the most immersive input device for VR, but writing a good low latency mouse code is not that hard
It is super easy, with this few steps .
1. Create a dedicated thread, then in that thread…
2. Create a window of type HWND_MESSAGE
3. register for raw mouse input with RegisterRawInputDevices
4. keep the thread running and process the window message WM_INPUT, it will have the mouse inputs.
a few recommendation :smile:
* you can use the buffered input API to collect all the wm_input at once and save a few hassle
* if you loop over peekmessage, you will sature a cpu core, use an outer loop with a first getmessage that get the thread to sleep.
* or just sleep(1ms) after you exhaust the message on a loop.
You now have access to raw message of the mouse, most gaming mouse can deliver update at 1000Hz, and adjusting the DPI will influence the delta amount you receive. But the big plus, you do not have any windows acceleration handling nor weirdness of mouse pointer control :) So your mouse is more like a gaming input like the xbox controller. - sbdykesExpert ProtegeTaking aside the question of it being a supported "VR experience" input device for a shipping application, this behavior is a massive pain-in-the-you-know-what for development. If I'm debugging something with my HMD active and displaying, I'm not wearing it, I'm looking at my monitor. You know what you use when interacting with your monitor? Your mouse. Having to alt-tab around to get a mouse pointer back is not a good workflow.
So, to my initial point, this should probably be something the application controls, or at the very least can tell the Oculus runtime to not do with a dev-only init parameter or some such. For non-VR game engines is a common thing to have a "dev mode" where you always have your mouse pointer, versus a "shipping mode" where the mouse is hidden and exclusive to the foreground game window. - wbskProtegeErm I and other have games in development that support the mouse and keyboard very well in VR. A lot of hardcore PC gamer's that have tried some of these including myself prefer keyboard/mouse controls in VR depending on the nature of the game. It shouldn't be Oculus choice to decide how we make our programs behave - it's the PC platform so it's up to us.
This a bit of disaster if you are saying mouse/keyboard is not fully supported, and that your software's is interfering with what is standard PC behaviour that should be up to the specific application.
If you want to enforce certain behaviours for programs that run from Oculus home and are available on your store that's understandable. But if programs are run outside of that then Oculus should respect standard system behaviours that have been there a long time for a good reason.
Also along with the other development irks I have mentioned in the other threads I think Oculus really needs to re-evaluate how people use their PC's and understand that it's not acceptable to try and take everything over to that extent you seem to be trying to.
I understand why this has probably happened but it's definitely very wrong... - jhericoAdventurer
cybereality said:
Mouse control is not recommended or fully supported currently in VR applications. If you are working on an app, you should aim to have it functioning with Xbox gamepad controls primarily (or Oculus Remote).
That is completely insane, both from the perspective of being able to reasonably develop on the platform and from the perspective of allowing VR to be perceived as something more than just an new niche gaming and entertainment platform for rich people. - joanProtegeAlso considering that the highest rated application on Share, "I expect you to die", is mouse-based.
- wbskProtegeI think it shows the start of a very worrying disconnect with the reality of their current PC enthusiast market. The vast majority of which who will experience VR whilst sat down expecting mouse/keyboard/gamepad control options depending on the nature of the application.
Please change your official stance on this Oculus. - cyberealityGrand Champion@galopin The main issue is mouse focus and how that interacts with Oculus Home and the application switching which one is currently active. I don't know all the details, but it seems difficult to guarantee that the client application has mouse focus. This may not be an insurmountable problem, but it's also not an easy thing from what I understand. The gamepad is not affected by this because defocused apps can still receive input from XInput. But I do understand the desire to support mouse controls and I can pass this feedback to the team.
- wbskProtegeThanks for recognising this cyberreality and sending the feedback to the team.
There are also valid non-game uses for VR where this along with Oculus Home integration currently would cause issues.
I think the best solution is good base sample code on recommended best practice behaviour rather than trying to hook and capture things in unexpected ways for windows applications.
It could be complicated as it really depends on the nature of the application so it should be left up to it. If Oculus feels it doesn't meet the required standards in that regard for being listed on the store then it can provisionally fail approval for the listing and enter a possible discussion with the developer to find a reasonable solution and update recommended practices if needed. - sbdykesExpert ProtegeThis is actually a bit worse than I thought. I incorrectly presumed that the Oculus runtime was simply changing the mouse cooperative mode for the VR app (i.e.; giving the VR app exclusive foreground access). However, it appears that it is actually taking away the mouse from the VR app completely. Meaning the mouse does not work at all for a VR app while the HMD is active. That...is somewhat shocking. Can anyone else confirm that this is happening for them on 1.3.0?
At this stage you (Oculus guys) are a little constrained to maintaining the current paradigm, since it's released and changing the default behavior could disrupt current or in-the-pipeline applications that are knowingly or unknowingly depending on the now-defined behavior. But I think a new initialization parameter or runtime property we can set to change the default mouse focus/input behavior might address the issue acceptably.
FWIW, I personally don't actually *depend* on mouse input for my project, and typically if you need to support console platforms you need to be controller-only capable anyways. It's a pain for my previously mentioned debugging reasons, but that can be worked around. But I am in agreement with the others in the thread that outright removing mouse input as an option doesn't seem reasonable, although I can see the line of logic that lead to that conclusion.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 10 years ago