Exemplo n.º 1
0
 public GamePadCapabilitiesEx(Dictionary <Keys, Buttons> keyMappings) : this()
 {
     this.IsConnected            = true;
     this.HasAButton             = keyMappings.ContainsValue(Buttons.A);
     this.HasBackButton          = keyMappings.ContainsValue(Buttons.A);
     this.HasBButton             = keyMappings.ContainsValue(Buttons.A);
     this.HasDPadDownButton      = keyMappings.ContainsValue(Buttons.A);
     this.HasDPadLeftButton      = keyMappings.ContainsValue(Buttons.A);
     this.HasDPadRightButton     = keyMappings.ContainsValue(Buttons.A);
     this.HasDPadUpButton        = keyMappings.ContainsValue(Buttons.A);
     this.HasLeftShoulderButton  = keyMappings.ContainsValue(Buttons.A);
     this.HasLeftStickButton     = keyMappings.ContainsValue(Buttons.A);
     this.HasRightShoulderButton = keyMappings.ContainsValue(Buttons.A);
     this.HasRightStickButton    = keyMappings.ContainsValue(Buttons.A);
     this.HasStartButton         = keyMappings.ContainsValue(Buttons.A);
     this.HasXButton             = keyMappings.ContainsValue(Buttons.A);
     this.HasYButton             = keyMappings.ContainsValue(Buttons.A);
     this.HasBigButton           = keyMappings.ContainsValue(Buttons.A);
     this.HasLeftXThumbStick     = keyMappings.ContainsValue(Buttons.A);
     this.HasLeftYThumbStick     = keyMappings.ContainsValue(Buttons.A);
     this.HasRightXThumbStick    = keyMappings.ContainsValue(Buttons.A);
     this.HasRightYThumbStick    = keyMappings.ContainsValue(Buttons.A);
     this.HasLeftTrigger         = keyMappings.ContainsValue(Buttons.A);
     this.HasRightTrigger        = keyMappings.ContainsValue(Buttons.A);
     this.HasLeftVibrationMotor  = false;
     this.HasRightVibrationMotor = false;
     this.HasVoiceSupport        = false;
     this.GamePadType            = GamePadType.GamePad;
 }
Exemplo n.º 2
0
 public GamePadCapabilitiesEx(GamePadCapabilities copy) : this()
 {
     this.IsConnected            = copy.IsConnected;
     this.HasAButton             = copy.HasAButton;
     this.HasBackButton          = copy.HasBackButton;
     this.HasBButton             = copy.HasBButton;
     this.HasDPadDownButton      = copy.HasDPadDownButton;
     this.HasDPadLeftButton      = copy.HasDPadLeftButton;
     this.HasDPadRightButton     = copy.HasDPadRightButton;
     this.HasDPadUpButton        = copy.HasDPadUpButton;
     this.HasLeftShoulderButton  = copy.HasLeftShoulderButton;
     this.HasLeftStickButton     = copy.HasLeftStickButton;
     this.HasRightShoulderButton = copy.HasRightShoulderButton;
     this.HasRightStickButton    = copy.HasRightStickButton;
     this.HasStartButton         = copy.HasStartButton;
     this.HasXButton             = copy.HasXButton;
     this.HasYButton             = copy.HasYButton;
     this.HasBigButton           = copy.HasBigButton;
     this.HasLeftXThumbStick     = copy.HasLeftXThumbStick;
     this.HasLeftYThumbStick     = copy.HasLeftYThumbStick;
     this.HasRightXThumbStick    = copy.HasRightXThumbStick;
     this.HasRightYThumbStick    = copy.HasRightYThumbStick;
     this.HasLeftTrigger         = copy.HasLeftTrigger;
     this.HasRightTrigger        = copy.HasRightTrigger;
     this.HasLeftVibrationMotor  = copy.HasLeftVibrationMotor;
     this.HasRightVibrationMotor = copy.HasRightVibrationMotor;
     this.HasVoiceSupport        = copy.HasVoiceSupport;
     this.GamePadType            = copy.GamePadType;
 }
Exemplo n.º 3
0
 private GamePadCapabilitiesEx(bool isKeyboard) : this()
 {
     this.IsConnected            = true;
     this.HasAButton             = true;
     this.HasBackButton          = true;
     this.HasBButton             = true;
     this.HasDPadDownButton      = true;
     this.HasDPadLeftButton      = true;
     this.HasDPadRightButton     = true;
     this.HasDPadUpButton        = true;
     this.HasLeftShoulderButton  = false;
     this.HasLeftStickButton     = false;
     this.HasRightShoulderButton = false;
     this.HasRightStickButton    = false;
     this.HasStartButton         = true;
     this.HasXButton             = true;
     this.HasYButton             = true;
     this.HasBigButton           = false;
     this.HasLeftXThumbStick     = true;
     this.HasLeftYThumbStick     = true;
     this.HasRightXThumbStick    = true;
     this.HasRightYThumbStick    = true;
     this.HasLeftTrigger         = true;
     this.HasRightTrigger        = true;
     this.HasLeftVibrationMotor  = false;
     this.HasRightVibrationMotor = false;
     this.HasVoiceSupport        = false;
     this.GamePadType            = GamePadType.GamePad;
 }
 /// <summary>
 /// Constructs the <see cref="GamePadCapabilities"/> with optional parameters.
 /// </summary>
 public GamePadCapabilities(
     bool isConnected            = false,
     string displayName          = null,
     string identifier           = null,
     bool hasAButton             = false,
     bool hasBButton             = false,
     bool hasBackButton          = false,
     bool hasDPadDownButton      = false,
     bool hasDPadLeftButton      = false,
     bool hasDPadRightButton     = false,
     bool hasDPadUpButton        = false,
     bool hasLeftShoulderButton  = false,
     bool hasLeftStickButton     = false,
     bool hasRightShoulderButton = false,
     bool hasRightStickButton    = false,
     bool hasStartButton         = false,
     bool hasXButton             = false,
     bool hasYButton             = false,
     bool hasBigButton           = false,
     bool hasLeftXThumbStick     = false,
     bool hasLeftYThumbStick     = false,
     bool hasRightXThumbStick    = false,
     bool hasRightYThumbStick    = false,
     bool hasLeftTrigger         = false,
     bool hasRightTrigger        = false,
     bool hasLeftVibrationMotor  = false,
     bool hasRightVibrationMotor = false,
     bool hasVoiceSupport        = false,
     GamePadType gamePadType     = GamePadType.Unknown)
 {
     IsConnected            = isConnected;
     DisplayName            = displayName;
     Identifier             = identifier;
     HasAButton             = hasAButton;
     HasBButton             = hasBButton;
     HasBackButton          = hasBackButton;
     HasDPadDownButton      = hasDPadDownButton;
     HasDPadLeftButton      = hasDPadLeftButton;
     HasDPadRightButton     = hasDPadRightButton;
     HasDPadUpButton        = hasDPadUpButton;
     HasLeftShoulderButton  = hasLeftShoulderButton;
     HasLeftStickButton     = hasLeftStickButton;
     HasRightShoulderButton = hasRightShoulderButton;
     HasRightStickButton    = hasRightStickButton;
     HasStartButton         = hasStartButton;
     HasXButton             = hasXButton;
     HasYButton             = hasYButton;
     HasBigButton           = hasBigButton;
     HasLeftXThumbStick     = hasLeftXThumbStick;
     HasLeftYThumbStick     = hasLeftYThumbStick;
     HasRightXThumbStick    = hasRightXThumbStick;
     HasRightYThumbStick    = hasRightYThumbStick;
     HasLeftTrigger         = hasLeftTrigger;
     HasRightTrigger        = hasRightTrigger;
     HasLeftVibrationMotor  = hasLeftVibrationMotor;
     HasRightVibrationMotor = hasRightVibrationMotor;
     HasVoiceSupport        = hasVoiceSupport;
     GamePadType            = gamePadType;
 }
Exemplo n.º 5
0
 internal GamePadCapabilities(GamePadType type, GamePadAxes axes, Buttons buttons, bool is_connected)
     : this()
 {
     gamepad_type = (byte)type;
     this.axes = axes;
     this.buttons = buttons;
     this.is_connected = is_connected;
 }
Exemplo n.º 6
0
        void IInputManager.Update(GameTime gameTime)
        {
            //TODO: React to this//if (currentPadState.IsConnected)
            lastPadState    = currentPadState;
            currentPadState = GamePad.GetState(index);

            padType = GamePad.GetCapabilities(index).GamePadType;
        }
Exemplo n.º 7
0
        public GamePadControls(int playerId, GamePadType padType)
        {
            playerIndex   = playerId;
            gamePad       = padType;
            controlPrefix = "{0}_GamePad_{1}_".FormatStr(gamePad, playerIndex);

            left    = "";
            right   = "";
            forward = "";
            back    = "";
            pause   = "";
            confirm = "";
            cancel  = "";
        }
Exemplo n.º 8
0
        public GamePadCapabilities GetCapabilities(int index)
        {
            XInputDeviceCapabilities xcaps;
            XInputErrorCode          error = xinput.GetCapabilities(
                (XInputUserIndex)index,
                XInputCapabilitiesFlags.Default,
                out xcaps);

            if (error == XInputErrorCode.Success)
            {
                GamePadType type    = TranslateSubType(xcaps.SubType);
                Buttons     buttons = TranslateButtons(xcaps.GamePad.Buttons);
                GamePadAxes axes    = TranslateAxes(ref xcaps.GamePad);

                return(new GamePadCapabilities(type, axes, buttons, true));
            }
            return(new GamePadCapabilities());
        }
 public void Reset()
 {
     IsLoginWX     = false;
     IsActiveGame  = false;
     m_GamePadType = GamePadType.Null;
 }
 public void Reset()
 {
     Index         = -1;
     m_GamePadType = GamePadType.Null;
 }
 public TVYaoKongPlayerData(int indexVal, GamePadType pad)
 {
     Index         = indexVal;
     m_GamePadType = pad;
 }
Exemplo n.º 12
0
 public void SetGamePadType(GamePadType type)
 {
     gamePadType = type;
 }
Exemplo n.º 13
0
 public GamePad()
 {
     gamePadIndex = 1;
     gamePadType  = GamePadType.XBOX;
     ApplyAxisName(string.Empty);
 }