Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
knup's avatar
knup
Honored Guest
11 years ago

Mouse Active Outside of Application

I found that the mouse is still active outside of my game (in direct mode, the unity app does not go full screen, some sort of hybrid windowed mode), so from time to time I catch the top of the window frame of the game on my laptop screen and therefore disrupt head tracking.

Any idea how to avoid this happening? Of course if the app would go proper full screen I would not have that issue, but this seems like something the SDK would have to solve.

5 Replies

Replies have been turned off for this discussion
  • drash's avatar
    drash
    Heroic Explorer
    You can try the following in a script somewhere:

    Screen.lockCursor = true;
    Screen.showCursor = false;

    And I think the OVRMainMenu in the current SDK already does this if you happen to be using that.
  • knup's avatar
    knup
    Honored Guest
    I actually need the mouse to work in-game. Maybe I should try to get mouse input without using the default cursor?
  • Gerald's avatar
    Gerald
    Expert Protege
    that is the best way to go anyway, since you can then place a real 3D mousecursor into the world.
  • knup's avatar
    knup
    Honored Guest
    I'll give this a go. Any pointers where to get started? If I disable the cursor, do I still have access to "Input.mousePosition"? What is the best approach for a 3d cursor in the world?
  • Gerald's avatar
    Gerald
    Expert Protege
    nothing changes really - inside the app you can keep working as is. just imagine your mousecursor is now a player character that you push around with your mouse.
    you might want to change some stuff if you are casting at the mouse cursor position - but to be honest I never went beyond simple concept myself since I figured that with VR I do not need a cursor and just use "looking at things in VR" as my cursor ;)