コード例 #1
0
ファイル: SEVRPlugin.cs プロジェクト: KlimeSE/SEVR
 static void Postfix(MyStringId context, MyStringId stringId, ref bool __result, bool joystickOnly = false, bool useXinput = false,
                     MyControlStateType type = MyControlStateType.NEW_PRESSED)
 {
     if (stringId == MyControlsSpace.LOOKAROUND && type == MyControlStateType.PRESSED)
     {
         __result = true;
     }
 }
コード例 #2
0
        public static bool IsControl(MyStringId context, MyStringId stringId, MyControlStateType type = MyControlStateType.NEW_PRESSED)
        {
            switch (type)
            { // temporary included cuz bindings support only joystick
            case MyControlStateType.NEW_PRESSED:
                return(MyInput.Static.IsNewGameControlPressed(stringId) || m_bindings[context][stringId].IsNewPressed());

            case MyControlStateType.NEW_RELEASED:
                return(MyInput.Static.IsNewGameControlReleased(stringId) || m_bindings[context][stringId].IsNewReleased());

            case MyControlStateType.PRESSED:
                return(MyInput.Static.IsGameControlPressed(stringId) || m_bindings[context][stringId].IsPressed());
            }

            return(false);
        }
コード例 #3
0
        public static bool IsControl(MyStringId context, MyStringId stringId, MyControlStateType type = MyControlStateType.NEW_PRESSED, bool joystickOnly = false)
        {
            switch (type)
            { // temporary included cuz bindings support only joystick
                case MyControlStateType.NEW_PRESSED:
                    return (!joystickOnly && MyInput.Static.IsNewGameControlPressed(stringId)) || m_bindings[context][stringId].IsNewPressed();
                case MyControlStateType.NEW_RELEASED:
                    return (!joystickOnly &&  MyInput.Static.IsNewGameControlReleased(stringId)) || m_bindings[context][stringId].IsNewReleased();
                case MyControlStateType.PRESSED:
                    return (!joystickOnly && MyInput.Static.IsGameControlPressed(stringId)) || m_bindings[context][stringId].IsPressed();
            }

            return false;
        }