Пример #1
0
    // Token: 0x0600561C RID: 22044 RVA: 0x001DA908 File Offset: 0x001D8D08
    public static VRCInput FindInput(string name)
    {
        VRCInput result = null;

        VRCInputManager.inputList.TryGetValue(name, out result);
        return(result);
    }
Пример #2
0
        public override void OnSceneWasInitialized(int buildIndex, string sceneName)
        {
            if (buildIndex != -1)
            {
                return;
            }

            useRight = VRCInputManager.Method_Public_Static_VRCInput_String_0("UseRight");
            useLeft  = VRCInputManager.Method_Public_Static_VRCInput_String_0("UseLeft");
        }
Пример #3
0
 // Token: 0x0600565A RID: 22106 RVA: 0x001DB4BC File Offset: 0x001D98BC
 public override void Apply()
 {
     VRCInput.ClearChanges();
     this.mouseUse.ApplyButton(Input.GetMouseButton(0));
     this.mouseGrab.ApplyButton(Input.GetMouseButton(0));
     this.mouseDrop.ApplyButton(Input.GetMouseButton(1));
     this.mouseX.ApplyAxis(Input.GetAxis("Mouse X"));
     this.mouseY.ApplyAxis(Input.GetAxis("Mouse Y"));
     this.mouseZ.ApplyAxis(Input.GetAxis("Mouse Wheel"));
     this._anyKey = VRCInput.IsChanged();
 }
 // Token: 0x0600563D RID: 22077 RVA: 0x001DAD08 File Offset: 0x001D9108
 public override void Apply()
 {
     VRCInput.ClearChanges();
     if (this.IsValidJoystickConnected())
     {
         if (Input.GetAxis("Joy1 Axis 9") > 0.3f)
         {
             this.inMoveHoldFB.ApplyAxis(Input.GetAxis("Joy1 Axis 2"));
             this.inSpinHoldCwCcw.ApplyAxis(Input.GetAxis("Joy1 Axis 1"));
             this.inSpinHoldUD.ApplyAxis(Input.GetAxis("Joy1 Axis 5"));
             this.inSpinHoldLR.ApplyAxis(Input.GetAxis("Joy1 Axis 4"));
         }
         else
         {
             this.inHorizontal.ApplyAxis(Input.GetAxis("Joy1 Axis 1"));
             this.inVertical.ApplyAxis(-Input.GetAxis("Joy1 Axis 2"));
             this.inLookHorizontal.ApplyAxis(Input.GetAxis("Joy1 Axis 4"));
             this.inLookVertical.ApplyAxis(Input.GetAxis("Joy1 Axis 5"));
             float axis = Input.GetAxis("Joy1 Axis 4");
             if (Mathf.Abs(axis) > 0.5f)
             {
                 this.inComfortLeft.ApplyButton(axis < 0f);
                 this.inComfortRight.ApplyButton(axis > 0f);
             }
         }
         this.inVoice.ApplyButton(Input.GetKey(KeyCode.Joystick1Button1));
         this.inSelect.ApplyButton(Input.GetKey(KeyCode.Joystick1Button0));
         this.inJump.ApplyButton(Input.GetKey(KeyCode.Joystick1Button3));
         this.inRun.ApplyButton(Input.GetKey(KeyCode.Joystick1Button4));
         if (!this._isOculusWithSteam)
         {
             this.inBack.ApplyButton(Input.GetKey(KeyCode.Joystick1Button6));
         }
         this.inMenu.ApplyButton(Input.GetKey(KeyCode.Joystick1Button7));
         this.inResetOrientation.ApplyButton(Input.GetKey(KeyCode.Joystick1Button6));
         this.inDrop.ApplyButton(Input.GetKey(KeyCode.Joystick1Button5));
         float axis2 = Input.GetAxis("Joy1 Axis 10");
         this.inUse.ApplyButton(axis2 > 0.3f);
         this.inUse.ApplyButton(Input.GetKey(KeyCode.Joystick1Button0));
         this.inGrab.ApplyButton(axis2 > 0.3f);
         this.inGrab.ApplyButton(Input.GetKey(KeyCode.Joystick1Button0));
         this.inDrop.ApplyButton(Input.GetKey(KeyCode.Joystick1Button2));
         this.inUseAxisRight.ApplyAxis(axis2);
         this.inGrabAxisRight.ApplyAxis(axis2);
     }
     this._anyKey = VRCInput.IsChanged();
 }
 // Token: 0x06005652 RID: 22098 RVA: 0x001DB24C File Offset: 0x001D964C
 public override void Apply()
 {
     VRCInput.ClearChanges();
     this.inMoveForward.ApplyButton(Input.GetKey(KeyCode.W));
     this.inMoveBackward.ApplyButton(Input.GetKey(KeyCode.S));
     this.inMoveLeft.ApplyButton(Input.GetKey(KeyCode.A));
     this.inMoveRight.ApplyButton(Input.GetKey(KeyCode.D));
     this.inVoice.ApplyButton(Input.GetKey(KeyCode.V));
     this.inSelect.ApplyButton(Input.GetKey(KeyCode.Return));
     this.inJump.ApplyButton(Input.GetKey(KeyCode.Space));
     this.inRun.ApplyButton(Input.GetKey(KeyCode.LeftShift));
     this.inBack.ApplyButton(Input.GetKey(KeyCode.Escape));
     this.inMenu.ApplyButton(Input.GetKey(KeyCode.Escape));
     this.inResetOrientation.ApplyButton(Input.GetKey(KeyCode.R));
     this.inToggleSitStand.ApplyButton(Input.GetKey(KeyCode.T));
     this.inComfortLeft.ApplyButton(Input.GetKey(KeyCode.Comma));
     this.inComfortRight.ApplyButton(Input.GetKey(KeyCode.Period));
     this.inCapturePanoramo.ApplyButton(Input.GetKey(KeyCode.P));
     this._anyKey = VRCInput.IsChanged();
 }
Пример #6
0
        public IEnumerator WaitForQM()
        {
            while (GameObject.Find("/UserInterface/Canvas_QuickMenu(Clone)/Container/Window/MicButton") == null) //Why wait for the MicButton, because I use this in other mods so I only need to fix one thing if it breaks in the future! Also you can't open the camera without going through the QM
            {
                yield return(new WaitForSeconds(1f));
            }
            _uiManagerInstance = (VRCUiManager)typeof(VRCUiManager).GetMethods().First(x => x.ReturnType == typeof(VRCUiManager)).Invoke(null, new object[0]);
            vertical           = VRCInputManager.field_Private_Static_Dictionary_2_String_VRCInput_0["Vertical"];
            horizontal         = VRCInputManager.field_Private_Static_Dictionary_2_String_VRCInput_0["Horizontal"];
            CreateIndicators();
            if (movementToggle.Value)
            {
                coroutine = MelonCoroutines.Start(AutoSet());
            }

            Logger.Msg(ConsoleColor.Green, $"Listing JoystickNames");
            foreach (var name in Input.GetJoystickNames())
            {
                Logger.Msg(ConsoleColor.Green, $"{name}");
            }
        }
Пример #7
0
    // Token: 0x06005663 RID: 22115 RVA: 0x001DB67C File Offset: 0x001D9A7C
    public override void Apply()
    {
        VRCInput.ClearChanges();
        this._anyKey = false;
        bool flag = false;

        if (!this._isUsingTouchControllers)
        {
            return;
        }
        if (this.viveControllerManager == null && VRCTrackingManager.IsInitialized())
        {
            this.viveControllerManager = VRCTrackingManager.GetTrackingComponent <SteamVR_ControllerManager>();
            return;
        }
        SteamVR_TrackedObject component = this.viveControllerManager.left.GetComponent <SteamVR_TrackedObject>();
        int index = (int)component.index;

        this.lControl = ((index < 0 || !component.isValid) ? null : SteamVR_Controller.Input(index));
        SteamVR_TrackedObject component2 = this.viveControllerManager.right.GetComponent <SteamVR_TrackedObject>();
        int index2 = (int)component2.index;

        this.rControl = ((index2 < 0 || !component2.isValid) ? null : SteamVR_Controller.Input(index2));
        if (this.IsControllerConnected(OVRInput.Controller.LTouch))
        {
            Vector2 axis2D = this.GetAxis2D(OVRInput.Axis2D.PrimaryThumbstick, OVRInput.Controller.LTouch);
            this.inVertical.ApplyAxis(axis2D.y);
            this.inHorizontal.ApplyAxis(axis2D.x);
            this.inTouchpadLeftClick.ApplyButton(false);
            this.inTouchpadLeftX.ApplyAxis(0f);
            this.inTouchpadLeftY.ApplyAxis(0f);
            this.inBack.ApplyButton(this.GetButton(OVRInput.Button.Two, OVRInput.Controller.LTouch) || this.GetButton(OVRInput.Button.Start, OVRInput.Controller.LTouch));
            this.inGrabLeft.ApplyButton(this.GetButton(OVRInput.Button.PrimaryHandTrigger, OVRInput.Controller.LTouch));
            this.inUseLeft.ApplyButton(this.GetButton(OVRInput.Button.PrimaryIndexTrigger, OVRInput.Controller.LTouch));
            this.inUseAxisLeft.ApplyAxis(this.GetAxis1D(OVRInput.Axis1D.PrimaryIndexTrigger, OVRInput.Controller.LTouch));
            this.inGrabAxisLeft.ApplyAxis(this.GetAxis1D(OVRInput.Axis1D.PrimaryHandTrigger, OVRInput.Controller.LTouch));
            this._inFaceTouchL.ApplyButton(this.GetNearTouch(OVRInput.NearTouch.PrimaryThumbButtons, OVRInput.Controller.LTouch));
            this._inFaceTouchL.ApplyButton(this.GetTouch(OVRInput.Touch.PrimaryThumbstick, OVRInput.Controller.LTouch) || this.GetTouch(OVRInput.Touch.One, OVRInput.Controller.LTouch) || this.GetTouch(OVRInput.Touch.Two, OVRInput.Controller.LTouch) || this.GetTouch(OVRInput.Touch.PrimaryThumbRest, OVRInput.Controller.LTouch));
            this._inFaceButtonTouchL.ApplyButton(this.GetTouch(OVRInput.Touch.PrimaryThumbstick, OVRInput.Controller.LTouch) || this.GetTouch(OVRInput.Touch.One, OVRInput.Controller.LTouch) || this.GetTouch(OVRInput.Touch.Two, OVRInput.Controller.LTouch));
            this._inTriggerTouchL.ApplyButton(this.GetNearTouch(OVRInput.NearTouch.PrimaryIndexTrigger, OVRInput.Controller.LTouch));
            this._inThumbRestTouchL.ApplyButton(this.GetTouch(OVRInput.Touch.PrimaryThumbstick, OVRInput.Controller.LTouch) || this.GetTouch(OVRInput.Touch.One, OVRInput.Controller.LTouch) || this.GetTouch(OVRInput.Touch.Two, OVRInput.Controller.LTouch));
            flag = VRCInput.IsChanged();
            this.inRun.ApplyButton(true);
            VRCInput.ClearChanges();
            if (this.GetVelocity(OVRInput.Controller.LTouch).sqrMagnitude > 0.1f)
            {
                VRCInput.MarkChanged();
            }
        }
        if (this.IsControllerConnected(OVRInput.Controller.RTouch))
        {
            Vector2 axis2D2 = this.GetAxis2D(OVRInput.Axis2D.PrimaryThumbstick, OVRInput.Controller.RTouch);
            if (axis2D2.x > 0.7f)
            {
                this.inLookHorizontal.ApplyAxis(1f);
                this.inComfortRight.ApplyButton(true);
            }
            else if (axis2D2.x < -0.7f)
            {
                this.inLookHorizontal.ApplyAxis(-1f);
                this.inComfortLeft.ApplyButton(true);
            }
            this.inTouchpadRightClick.ApplyButton(false);
            this.inTouchpadRightX.ApplyAxis(0f);
            this.inTouchpadRightY.ApplyAxis(0f);
            this.inMenu.ApplyButton(this.GetButton(OVRInput.Button.Two, OVRInput.Controller.RTouch));
            this.inGrabRight.ApplyButton(this.GetButton(OVRInput.Button.PrimaryHandTrigger, OVRInput.Controller.RTouch));
            this.inUseRight.ApplyButton(this.GetButton(OVRInput.Button.PrimaryIndexTrigger, OVRInput.Controller.RTouch));
            this.inUseAxisRight.ApplyAxis(this.GetAxis1D(OVRInput.Axis1D.PrimaryIndexTrigger, OVRInput.Controller.RTouch));
            this.inGrabAxisRight.ApplyAxis(this.GetAxis1D(OVRInput.Axis1D.PrimaryHandTrigger, OVRInput.Controller.RTouch));
            this._inFaceTouchR.ApplyButton(this.GetNearTouch(OVRInput.NearTouch.PrimaryThumbButtons, OVRInput.Controller.RTouch));
            this._inFaceTouchR.ApplyButton(this.GetTouch(OVRInput.Touch.PrimaryThumbstick, OVRInput.Controller.RTouch) || this.GetTouch(OVRInput.Touch.One, OVRInput.Controller.RTouch) || this.GetTouch(OVRInput.Touch.Two, OVRInput.Controller.RTouch) || this.GetTouch(OVRInput.Touch.PrimaryThumbRest, OVRInput.Controller.RTouch));
            this._inFaceButtonTouchR.ApplyButton(this.GetTouch(OVRInput.Touch.PrimaryThumbstick, OVRInput.Controller.RTouch) || this.GetTouch(OVRInput.Touch.One, OVRInput.Controller.RTouch) || this.GetTouch(OVRInput.Touch.Two, OVRInput.Controller.RTouch));
            this._inTriggerTouchR.ApplyButton(this.GetNearTouch(OVRInput.NearTouch.PrimaryIndexTrigger, OVRInput.Controller.RTouch));
            this._inThumbRestTouchR.ApplyButton(this.GetTouch(OVRInput.Touch.PrimaryThumbstick, OVRInput.Controller.RTouch) || this.GetTouch(OVRInput.Touch.One, OVRInput.Controller.RTouch) || this.GetTouch(OVRInput.Touch.Two, OVRInput.Controller.RTouch));
            this.inJump.ApplyButton(this.GetButton(OVRInput.Button.PrimaryThumbstick, OVRInput.Controller.RTouch));
            if (this.GetVelocity(OVRInput.Controller.RTouch).sqrMagnitude > 0.1f)
            {
                VRCInput.MarkChanged();
            }
        }
        this._anyKey = (flag || VRCInput.IsChanged());
    }
Пример #8
0
 // Token: 0x06005646 RID: 22086 RVA: 0x001DB178 File Offset: 0x001D9578
 public override void Apply()
 {
     VRCInput.ClearChanges();
     this._anyKey = VRCInput.IsChanged();
 }
Пример #9
0
 // Token: 0x060055DE RID: 21982 RVA: 0x001D9481 File Offset: 0x001D7881
 public void SetAxisButtons(VRCInput pos, VRCInput neg)
 {
     this.positive = pos;
     this.negative = neg;
 }
Пример #10
0
    // Token: 0x06005674 RID: 22132 RVA: 0x001DC090 File Offset: 0x001DA490
    public override void Apply()
    {
        VRCInput.ClearChanges();
        this._anyKey = false;
        bool flag = false;

        if (this.viveControllerManager == null && VRCTrackingManager.IsInitialized())
        {
            this.viveControllerManager = VRCTrackingManager.GetTrackingComponent <SteamVR_ControllerManager>();
            return;
        }
        if (!SteamVR.active)
        {
            return;
        }
        if (!this._isUsingViveControllers)
        {
            return;
        }
        SteamVR_TrackedObject component = this.viveControllerManager.left.GetComponent <SteamVR_TrackedObject>();
        int index = (int)component.index;

        if (index >= 0 && component.isValid)
        {
            SteamVR_Controller.Device device = SteamVR_Controller.Input(index);
            Vector2 axis = device.GetAxis(EVRButtonId.k_EButton_Axis0);
            if (device.GetPress(EVRButtonId.k_EButton_Axis0))
            {
                axis.Normalize();
                this.inVertical.ApplyAxis(axis.y);
                this.inHorizontal.ApplyAxis(axis.x);
                this.inTouchpadLeftClick.ApplyButton(true);
            }
            else
            {
                this.inTouchpadLeftClick.ApplyButton(false);
            }
            if (device.GetTouch(EVRButtonId.k_EButton_Axis0))
            {
                this.inTouchpadLeftX.ApplyAxis(axis.x);
                this.inTouchpadLeftY.ApplyAxis(axis.y);
            }
            else
            {
                this.inTouchpadLeftX.ApplyAxis(0f);
                this.inTouchpadLeftY.ApplyAxis(0f);
            }
            this.inBack.ApplyButton(device.GetPress(EVRButtonId.k_EButton_ApplicationMenu));
            flag = VRCInput.IsChanged();
            this.inRun.ApplyButton(true);
            VRCInput.ClearChanges();
            this.inDropLeft.ApplyButton(device.GetPress(EVRButtonId.k_EButton_Grip));
            this.inUseLeft.ApplyButton(device.GetHairTrigger());
            this.inGrabLeft.ApplyButton(device.GetHairTrigger());
            Vector2 axis2 = device.GetAxis(EVRButtonId.k_EButton_Axis1);
            this.inUseAxisLeft.ApplyAxis(axis2.x);
            this.inGrabAxisLeft.ApplyAxis(axis2.x);
            if (device.velocity.sqrMagnitude > 0.1f)
            {
                VRCInput.MarkChanged();
            }
        }
        SteamVR_TrackedObject component2 = this.viveControllerManager.right.GetComponent <SteamVR_TrackedObject>();
        int index2 = (int)component2.index;

        if (index2 >= 0 && component2.isValid)
        {
            SteamVR_Controller.Device device2 = SteamVR_Controller.Input(index2);
            Vector2 axis3 = device2.GetAxis(EVRButtonId.k_EButton_Axis0);
            if (device2.GetPress(EVRButtonId.k_EButton_Axis0))
            {
                if (axis3.y > 0.7f)
                {
                    if (device2.GetPressDown(EVRButtonId.k_EButton_Axis0))
                    {
                        this.inJump.ApplyButton(true);
                    }
                }
                else if (axis3.x > 0.7f)
                {
                    this.inLookHorizontal.ApplyAxis(1f);
                    this.inComfortRight.ApplyButton(true);
                }
                else if (axis3.x < -0.7f)
                {
                    this.inLookHorizontal.ApplyAxis(-1f);
                    this.inComfortLeft.ApplyButton(true);
                }
                this.inTouchpadRightClick.ApplyButton(true);
            }
            else
            {
                this.inTouchpadRightClick.ApplyButton(false);
            }
            if (device2.GetTouch(EVRButtonId.k_EButton_Axis0))
            {
                this.inTouchpadRightX.ApplyAxis(axis3.x);
                this.inTouchpadRightY.ApplyAxis(axis3.y);
            }
            else
            {
                this.inTouchpadRightX.ApplyAxis(0f);
                this.inTouchpadRightY.ApplyAxis(0f);
            }
            this.inMenu.ApplyButton(device2.GetPress(EVRButtonId.k_EButton_ApplicationMenu));
            this.inDropRight.ApplyButton(device2.GetPress(EVRButtonId.k_EButton_Grip));
            this.inUseRight.ApplyButton(device2.GetHairTrigger());
            this.inGrabRight.ApplyButton(device2.GetHairTrigger());
            Vector2 axis4 = device2.GetAxis(EVRButtonId.k_EButton_Axis1);
            this.inUseAxisRight.ApplyAxis(axis4.x);
            this.inGrabAxisRight.ApplyAxis(axis4.x);
            if (device2.velocity.sqrMagnitude > 0.1f)
            {
                VRCInput.MarkChanged();
            }
        }
        this._anyKey = (flag || VRCInput.IsChanged());
    }