HoloLite Posted January 23, 2018 Share Posted January 23, 2018 Using the winmr controllers, how can one register for event callback for the clicked menu button? Thanks Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 23, 2018 Share Posted January 23, 2018 Hello, controller.onMenuButtonStateChangedObservable should do the trick Quote Link to comment Share on other sites More sharing options...
HoloLite Posted January 24, 2018 Author Share Posted January 24, 2018 The thing is that I don't know where to get the correct reference to the controller object. I did the following Prior to this I did call scene.createDefaultVRExperience(). let controller = <BABYLON.WindowsMotionController>this._vrHelper.webVRCamera.rightController; controller.onMenuButtonStateChangedObservable.add((eventData: BABYLON.ExtendedGamepadButton, eventState: BABYLON.EventState) => { this.menuButtonObserver(eventData, eventState); }); But got exception thrown about property of onMenuButtonStateChangedObservable being null. Quote Link to comment Share on other sites More sharing options...
HoloLite Posted January 24, 2018 Author Share Posted January 24, 2018 I think I found the right place to hook the callback. this._vrHelper.onControllerMeshLoadedObservable.add(...) This would do it. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 24, 2018 Share Posted January 24, 2018 yep! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.