12-28-2016 09:34 AM
12-29-2016 01:48 AM
01-02-2017 12:37 AM
if (OVRInput.GetActiveController() != OVRInput.Controller.Touchpad) { /* do input handling */ }We recently added touchpad support to OVRInput and without the above check, you may get your gamepad button handling logic firing at unexpected times in addition to the usual touchpad handling code.
01-03-2017 07:20 AM
Debug.Log(OVRInput.GetActiveController().ToString());
First click prints None and immedeatelly after it prints Touchpad. Every click after that prints Touchpad twice. Checking if there are multiple copies of components mentioned above was the first thing I did. 01-23-2017 01:23 AM
01-24-2017 01:37 AM
03-13-2017 06:21 AM
04-11-2017 03:37 AM
05-11-2017 07:08 PM
05-12-2017 07:06 AM
virtual protected PointerEventData.FramePressState GetGazeButtonState()
{
//var pressed = Input.GetKeyDown(gazeClickKey) || OVRInput.GetDown(joyPadClickButton);
//var released = Input.GetKeyUp(gazeClickKey) || OVRInput.GetUp(joyPadClickButton);
//#if UNITY_ANDROID && !UNITY_EDITOR
// // On Gear VR the mouse button events correspond to touch pad events. We only use these as gaze pointer clicks
// // on Gear VR because on PC the mouse clicks are used for actual mouse pointer interactions.
// pressed |= Input.GetMouseButtonDown(0);
// released |= Input.GetMouseButtonUp(0);
//#endif
var pressed = Input.GetMouseButtonDown(0);
var released = Input.GetMouseButtonUp(0);
if (pressed && released)
return PointerEventData.FramePressState.PressedAndReleased;
if (pressed)
return PointerEventData.FramePressState.Pressed;
if (released)
return PointerEventData.FramePressState.Released;
return PointerEventData.FramePressState.NotChanged;
}