Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

Swipe on Oculus GO Touchpad triggers UI clicks when it shouldn't

INVR.SPACEINVR.SPACE Posts: 3
NerveGear

Using: Unity 2018.4.1 LTS & Oculus GO

I am using a gaze pointer to interact with Unity UI.

This is supposed to happen when you pull the trigger, exactly how I defined it in my script: a swipe left or right on the touchpad of the go-controller however triggers clicks as well. I did not define this myself, it's just a thing that happens and I can not figure out how to work around it.

I found and fiddled around with solutions proposed in this thread and this thread.

However, none of these solutions provided me a way to get rid of these swipe clicks while keeping alive index trigger clicks.

My Input Manager (Index Trigger Interaction with UI seems to happen in OVRInputModule):


 private void Update()
        {

            if (OVRInput.GetDown(OVRInput.Button.PrimaryTouchpad) || OVRInput.GetDown(OVRInput.Button.Two))
            {
                ToggleVidInterface();

            }

            if (OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger))
            {
                StartCoroutine(TouchpadCounter()); 
            }

        }

        IEnumerator TouchpadCounter()
        {
            int secondsForCounting = 2;
            float startTime = Time.time;
            int touchCount = 0;

            while (Time.time - startTime <= secondsForCounting && OVRInput.Get(OVRInput.Button.PrimaryIndexTrigger))
            {
                if (OVRInput.GetDown(OVRInput.Button.PrimaryTouchpad))
                {
                    touchCount++;
                    Debug.Log("touchCount for Admin Menue: " + touchCount);
                }

                if (touchCount >= 3)
                {
                    ActivateAdminMenue();
                }

                yield return null;
            }

            yield return null;
        }

Part of the OVRInputModule (I don't know if its the right part):

        /// <summary>
        /// Get state of button corresponding to gaze pointer
        /// </summary>
        /// <returns></returns>
        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



            if (pressed && released)
                return PointerEventData.FramePressState.PressedAndReleased;
            if (pressed)
                return PointerEventData.FramePressState.Pressed;
            if (released)
                return PointerEventData.FramePressState.Released;
            return PointerEventData.FramePressState.NotChanged;
        }

Messing with the Android if condition just enables or disables clicking as a whole (trigger and touchpad). What am I missing here? How can I seperate between a trigger click and a touchpad swipe?!

Comments

  • mattbenicmattbenic Posts: 25
    Brain Burst
    edited October 8
    Did you ever find a solution to this? I had the same issue on the Quest and ended up:
    1. Exposing different "joyPadClickButton" fields for Go, Quest and "default"
    2. Checking what device the app is running on with OVRPlugin.GetSystemHeadsetType() and using the appropriate button for clicks
    3. Only doing the "pressed |= .." calls if not running on Go or Quest

    This works, but if there's a more elegant solution I'd like to know about it.
Sign In or Register to comment.