Skip to content

Conversation

@olga-microsoft
Copy link
Contributor

…element with the possibility to disable the behavior (on by default)

Description:
Support mouse input in WebVR by handling vrdisplaypointerrestricted and vrdisplaypointerunrestricted events in MS Edge. It is by design that mozPointerLock* and webkitPointerLock* implementations are not included.

Changes proposed:

  • In response to vrdisplaypointerrestricted perform requestPointerLock on the canvas element that is used for WebVR rendering
  • In response to vrdisplaypointerunrestricted perform document.exitPointerLock if the locked element is the canvas that is used for WebVR rendering
  • Give the developer an option to turn off this behavior by calling disableCanvasPointerLock on the scene object.

writable: window.debug
},

enableCanvasPointerLock: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the scenarios where someone would want to enable / disable this? I don't fully understand Edge WebVR behavior. I'm poking on this with partial information.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wanted to be flexible. I can't think of a scenario that this would be useful. I will remove this if it's okay with you.

Copy link
Member

@dmarcos dmarcos Sep 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a maintainer I'm becoming more and more flag averse over time 😄 since new flags combine with previous ones that can interact in multiple weird ways that are difficult to debug and maintain over time. As a conservative measure I would get rid of the flag now and reintroduce it later if we found a legitimate use case for it. I cannot think of any at the moment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, this makes sense, removing!

@olga-microsoft olga-microsoft force-pushed the msft/pointerrestrictedeventhandling branch from 97c1e0d to 898fd0e Compare September 1, 2017 21:07
@dmarcos
Copy link
Member

dmarcos commented Sep 1, 2017

Thanks!

@dmarcos dmarcos merged commit 4da6d75 into aframevr:master Sep 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants