コード例 #1
0
 private void OnPadReleased(object sender, VRInputEventArgs e)
 {
     Debug.Log(e.HandRole + " Pad Released");
     m_Inputs[Interaction.PadReleased] = e;
     m_Inputs[Interaction.PadPressed]  = null;
     m_Inputs[Interaction.PadTouched]  = null;
 }
コード例 #2
0
        //================================================================



        //+---------------------------+
        //| Check For Trigger Release |
        //+---------------------------+
        private void CheckTriggerReleased(HandRole hr)
        {
            if (ViveInput.GetPressUp(hr, ControllerButton.Trigger))
            {
                VRInputEventArgs args = new VRInputEventArgs();
                args.ButtonPressed = ControllerButton.Trigger;
                args.HandRole      = hr;
                args.Timestamp     = DateTime.Now;
                OnTriggerReleased(args);
            }
            else if (ViveInput.GetPressUp(hr, ControllerButton.TriggerTouch))
            {
                VRInputEventArgs args = new VRInputEventArgs();
                args.ButtonPressed = ControllerButton.TriggerTouch;
                args.HandRole      = hr;
                args.Timestamp     = DateTime.Now;
                OnTriggerReleased(args);
            }
            else if (ViveInput.GetPressUp(hr, ControllerButton.FullTrigger))
            {
                VRInputEventArgs args = new VRInputEventArgs();
                args.ButtonPressed = ControllerButton.FullTrigger;
                args.HandRole      = hr;
                args.Timestamp     = DateTime.Now;
                OnTriggerReleased(args);
            }
        }
コード例 #3
0
 private void OnTriggerReleased(object sender, VRInputEventArgs e)
 {
     Debug.Log(e.HandRole + " Trigger Released");
     m_Inputs[Interaction.TriggerReleased] = e;
     m_Inputs[Interaction.TriggerClicked]  = null;
     m_Inputs[Interaction.TriggerTapped]   = null;
     m_Inputs[Interaction.TriggerHeld]     = null;
 }
コード例 #4
0
        //================================================================



        //+---------------------+
        //| Signal Pad Released |
        //+---------------------+
        protected virtual void OnTriggerReleased(VRInputEventArgs e)
        {
            EventHandler <VRInputEventArgs> handler = TriggerReleased;

            if (handler != null)
            {
                handler(this, e);
            }
        }
コード例 #5
0
        //================================================================



        //+--------------------+
        //| Signal Pad Touched |
        //+--------------------+
        protected virtual void OnPadTouched(VRInputEventArgs e)
        {
            EventHandler <VRInputEventArgs> handler = PadTouched;

            if (handler != null)
            {
                handler(this, e);
            }
        }
コード例 #6
0
        //================================================================



        //+---------------------+
        //| Signal Menu Pressed |
        //+---------------------+
        protected virtual void OnMenuPressed(VRInputEventArgs e)
        {
            EventHandler <VRInputEventArgs> handler = MenuPressed;

            if (handler != null)
            {
                handler(this, e);
            }
        }
コード例 #7
0
        //================================================================



        //+------------------------+
        //| Check For Menu Release |
        //+------------------------+
        private void CheckMenuReleased(HandRole hr)
        {
            if (ViveInput.GetPressUp(hr, ControllerButton.Menu))
            {
                VRInputEventArgs args = new VRInputEventArgs();
                args.ButtonPressed = ControllerButton.Menu;
                args.HandRole      = hr;
                args.Timestamp     = DateTime.Now;
                OnMenuReleased(args);
            }
        }
コード例 #8
0
        //================================================================



        //+----------------------------------------------------+
        //| Check For Trigger Clicked / Full Press / Full Hold |
        //+----------------------------------------------------+
        private void CheckTriggerClicked(HandRole hr)
        {
            if (ViveInput.GetPressDown(hr, ControllerButton.FullTrigger))
            {
                VRInputEventArgs args = new VRInputEventArgs();
                args.ButtonPressed = ControllerButton.FullTrigger;
                args.HandRole      = hr;
                args.Timestamp     = DateTime.Now;
                OnTriggerClicked(args);
            }
        }
コード例 #9
0
 //+------------------------+
 //| Check For Grip Pressed |
 //+------------------------+
 private void CheckGripPressed(HandRole hr)
 {
     if (ViveInput.GetPress(hr, ControllerButton.Grip))
     {
         VRInputEventArgs args = new VRInputEventArgs();
         args.ButtonPressed = ControllerButton.Grip;
         args.HandRole      = hr;
         args.Timestamp     = DateTime.Now;
         OnGripPressed(args);
     }
 }
コード例 #10
0
        //================================================================



        //+-----------------------+
        //| Check For Pad Touched |
        //+-----------------------+
        private void CheckPadTouched(HandRole hr)
        {
            if (ViveInput.GetPressDown(hr, ControllerButton.PadTouch))
            {
                VRInputEventArgs args = new VRInputEventArgs();
                args.ButtonPressed    = ControllerButton.PadTouch;
                args.HandRole         = hr;
                args.TouchCoordinates = ViveInput.GetPadAxis(hr);
                args.Timestamp        = DateTime.Now;
                OnPadTouched(args);
            }
        }
コード例 #11
0
        //================================================================



        //+-------------------------------------------------+
        //| Signal Trigger Clicked / Full Press / Full Hold |
        //+-------------------------------------------------+
        protected virtual void OnTriggerClicked(VRInputEventArgs e)
        {
            /* Activates If:
             *      1) Trigger if Held at least to 100% of the way
             *      2) Trigger is Pressed at least to 100% of the way
             */
            EventHandler <VRInputEventArgs> handler = TriggerClicked;

            if (handler != null)
            {
                handler(this, e);
            }
        }
コード例 #12
0
 private void OnMenuReleased(object sender, VRInputEventArgs e)
 {
     Debug.Log(e.HandRole + " Menu Button Released");
     m_Inputs[Interaction.MenuReleased] = e;
     m_Inputs[Interaction.MenuPressed]  = null;
 }
コード例 #13
0
 private void OnGripReleased(object sender, VRInputEventArgs e)
 {
     Debug.Log(e.HandRole + " Grip Released");
     m_Inputs[Interaction.GripReleased] = e;
     m_Inputs[Interaction.GripPressed]  = null;
 }