borismus / webvr-boilerplate

A starting point for web-based VR experiences that work on all VR headsets.
Apache License 2.0
1.8k stars 451 forks source link

Listening for modechange? #91

Closed RogueSheep-nl closed 8 years ago

RogueSheep-nl commented 8 years ago

Feeling kinda noobish here as I'm not quite familiar with custom events. How do I listen for the 'modechange' event issues by the vrManager? I've tried: [document|window].addEventListener('modechange', myFunc, false);

Thanks for any pointers in the right direction.

borismus commented 8 years ago

The manager itself issues this event. You can observe it by calling webVRManagerInstance.on('modechange', myFunc).

RogueSheep-nl commented 8 years ago

Thanks!