Merge pull request #8030 from howard-stearns/fix-paused-interactions-with-mouse

fix paused interactions with mouse
This commit is contained in:
Howard Stearns 2016-06-13 11:28:47 -07:00 committed by GitHub
commit 357ccc17aa
2 changed files with 7 additions and 5 deletions

View file

@ -176,9 +176,11 @@ function goAway() {
// tell the Reticle, we want to stop capturing the mouse until we come back
Reticle.allowMouseCapture = false;
if (HMD.active) {
Reticle.visible = false;
}
// Allow users to find their way to other applications, our menus, etc.
// For desktop, that means we want the reticle visible.
// For HMD, the hmd preview will show the system mouse because of allowMouseCapture,
// but we want to turn off our Reticle so that we don't get two in preview and a stuck one in headset.
Reticle.visible = !HMD.active;
wasHmdMounted = safeGetHMDMounted(); // always remember the correct state
avatarPosition = MyAvatar.position;

View file

@ -410,8 +410,8 @@ function update() {
if (!Menu.isOptionChecked("First Person")) {
return turnOffVisualization(); // What to do? menus can be behind hand!
}
if (!Window.hasFocus()) {
return turnOffVisualization(); // Don't mess with other apps
if (!Window.hasFocus() || !Reticle.allowMouseCapture) {
return turnOffVisualization(); // Don't mess with other apps or paused mouse activity
}
leftTrigger.update();
rightTrigger.update();