예제 #1
0
        void O_M_C_Input_GamePadListener.onAxisChanged(GamePad gamePad, int axisCode, float axisValue)
        {
            switch ((MonoGameGamePad.AxisCodes)axisCode)
            {
            case MonoGameGamePad.AxisCodes.LeftThumbstickX:
                notifyLeftStickXMoved(axisValue);
                break;

            case MonoGameGamePad.AxisCodes.LeftThumbstickY:
                notifyLeftStickYMoved(axisValue);
                break;

            case MonoGameGamePad.AxisCodes.RightThumbstickX:
                notifyRightStickXMoved(axisValue);
                break;

            case MonoGameGamePad.AxisCodes.RightThumbstickY:
                notifyRightStickYMoved(axisValue);
                break;

            case MonoGameGamePad.AxisCodes.LeftTrigger:
                notifyL2Moved(axisValue);
                break;

            case MonoGameGamePad.AxisCodes.RightTrigger:
                notifyR2Moved(axisValue);
                break;
            }
        }
예제 #2
0
        void O_M_C_Input_GamePadListener.onButtonDown(GamePad gamePad, int buttonCode)
        {
            var button = buttonCodeToPS4Button(buttonCode);

            if (button != null)
            {
                notifyButtonDown(button);
            }
        }
예제 #3
0
        void O_M_C_Input_GamePadListener.onPovChanged(GamePad gamePad, int povCode, PovState povState)
        {
            if (povState.isPressed(PovState.NORTH_) != _prevPovState.isPressed(PovState.NORTH_))
            {
                if (povState.isPressed(PovState.NORTH_))
                {
                    notifyButtonDown(PS4Button.UP_);
                }
                else
                {
                    notifyButtonUp(PS4Button.UP_);
                }
            }
            if (povState.isPressed(PovState.SOUTH_) != _prevPovState.isPressed(PovState.SOUTH_))
            {
                if (povState.isPressed(PovState.SOUTH_))
                {
                    notifyButtonDown(PS4Button.DOWN_);
                }
                else
                {
                    notifyButtonUp(PS4Button.DOWN_);
                }
            }
            if (povState.isPressed(PovState.EAST_) != _prevPovState.isPressed(PovState.EAST_))
            {
                if (povState.isPressed(PovState.EAST_))
                {
                    notifyButtonDown(PS4Button.RIGHT_);
                }
                else
                {
                    notifyButtonUp(PS4Button.RIGHT_);
                }
            }
            if (povState.isPressed(PovState.WEST_) != _prevPovState.isPressed(PovState.WEST_))
            {
                if (povState.isPressed(PovState.WEST_))
                {
                    notifyButtonDown(PS4Button.LEFT_);
                }
                else
                {
                    notifyButtonUp(PS4Button.LEFT_);
                }
            }

            _prevPovState = povState;
        }
예제 #4
0
 void O_M_C_Input_GamePadListener.onDisconnect(GamePad gamePad)
 {
     notifyDisconnected();
 }
예제 #5
0
 public MonoGamePS4GamePad(GamePad gamePad) : base()
 {
     base._init_(gamePad);
     _prevPovState = gamePad.getPov(0);
 }
예제 #6
0
 public MonoGamePS4GamePad(GamePad gamePad, DeadZone leftStickDeadZone, DeadZone rightStickDeadZone) : base()
 {
     base._init_(gamePad, leftStickDeadZone, rightStickDeadZone);
     _prevPovState = gamePad.getPov(0);
 }
예제 #7
0
 void O_M_C_Input_GamePadListener.onAccelerometerChanged(GamePad gamePad, int accelerometerCode, Vector3 value)
 {
 }
예제 #8
0
 public MonoGamePS4GamePad(GamePad gamePad) : base()
 {
     base._init_(gamePad);
 }
예제 #9
0
 public MonoGamePS4GamePad(GamePad gamePad, DeadZone leftStickDeadZone, DeadZone rightStickDeadZone) : base()
 {
     base._init_(gamePad, leftStickDeadZone, rightStickDeadZone);
 }
예제 #10
0
 public SwitchJoyConLGamePad newSwitchJoyConLGamePad(GamePad gamePad)
 {
     throw new NotImplementedException();
 }
예제 #11
0
 public PS4GamePad newPS4GamePad(GamePad gamePad)
 {
     return(new MonoGamePS4GamePad(gamePad));
 }
예제 #12
0
 public XboxGamePad newXboxGamePad(GamePad gamePad)
 {
     return(new MonoGameXboxGamePad(gamePad));
 }