Class GamePad
Supports querying the game controllers and setting the vibration motors.
public static class GamePad
  - Inheritance
 - 
      
      GamePad
 
- Inherited Members
 
Properties
MaximumGamePadCount
The maximum number of game pads supported on this system.
public static int MaximumGamePadCount { get; }
  Property Value
Methods
GetCapabilities(PlayerIndex)
Returns the capabilities of the connected controller.
public static GamePadCapabilities GetCapabilities(PlayerIndex playerIndex)
  Parameters
playerIndexPlayerIndexPlayer index for the controller you want to query.
Returns
- GamePadCapabilities
 The capabilities of the controller.
GetCapabilities(int)
Returns the capabilities of the connected controller.
public static GamePadCapabilities GetCapabilities(int index)
  Parameters
indexintIndex for the controller you want to query.
Returns
- GamePadCapabilities
 The capabilities of the controller.
GetState(PlayerIndex)
Gets the current state of a game pad controller with an independent axes dead zone.
public static GamePadState GetState(PlayerIndex playerIndex)
  Parameters
playerIndexPlayerIndexPlayer index for the controller you want to query.
Returns
- GamePadState
 The state of the controller.
GetState(PlayerIndex, GamePadDeadZone)
Gets the current state of a game pad controller, using a specified dead zone on analog stick positions.
public static GamePadState GetState(PlayerIndex playerIndex, GamePadDeadZone deadZoneMode)
  Parameters
playerIndexPlayerIndexPlayer index for the controller you want to query.
deadZoneModeGamePadDeadZoneEnumerated value that specifies what dead zone type to use.
Returns
- GamePadState
 The state of the controller.
GetState(PlayerIndex, GamePadDeadZone, GamePadDeadZone)
Gets the current state of a game pad controller, using a specified dead zone on analog stick positions.
public static GamePadState GetState(PlayerIndex playerIndex, GamePadDeadZone leftDeadZoneMode, GamePadDeadZone rightDeadZoneMode)
  Parameters
playerIndexPlayerIndexPlayer index for the controller you want to query.
leftDeadZoneModeGamePadDeadZoneEnumerated value that specifies what dead zone type to use for the left stick.
rightDeadZoneModeGamePadDeadZoneEnumerated value that specifies what dead zone type to use for the right stick.
Returns
- GamePadState
 The state of the controller.
GetState(int)
Gets the current state of a game pad controller with an independent axes dead zone.
public static GamePadState GetState(int index)
  Parameters
indexintIndex for the controller you want to query.
Returns
- GamePadState
 The state of the controller.
GetState(int, GamePadDeadZone)
Gets the current state of a game pad controller, using a specified dead zone on analog stick positions.
public static GamePadState GetState(int index, GamePadDeadZone deadZoneMode)
  Parameters
indexintIndex for the controller you want to query.
deadZoneModeGamePadDeadZoneEnumerated value that specifies what dead zone type to use.
Returns
- GamePadState
 The state of the controller.
GetState(int, GamePadDeadZone, GamePadDeadZone)
Gets the current state of a game pad controller, using a specified dead zone on analog stick positions.
public static GamePadState GetState(int index, GamePadDeadZone leftDeadZoneMode, GamePadDeadZone rightDeadZoneMode)
  Parameters
indexintIndex for the controller you want to query.
leftDeadZoneModeGamePadDeadZoneEnumerated value that specifies what dead zone type to use for the left stick.
rightDeadZoneModeGamePadDeadZoneEnumerated value that specifies what dead zone type to use for the right stick.
Returns
- GamePadState
 The state of the controller.
SetVibration(PlayerIndex, float, float)
Sets the vibration motor speeds on the controller device if supported.
public static bool SetVibration(PlayerIndex playerIndex, float leftMotor, float rightMotor)
  Parameters
playerIndexPlayerIndexPlayer index that identifies the controller to set.
leftMotorfloatThe speed of the left motor, between 0.0 and 1.0. This motor is a low-frequency motor.
rightMotorfloatThe speed of the right motor, between 0.0 and 1.0. This motor is a high-frequency motor.
Returns
- bool
 Returns true if the vibration motors were set.
SetVibration(PlayerIndex, float, float, float, float)
Sets the vibration motor speeds on the controller device if supported.
public static bool SetVibration(PlayerIndex playerIndex, float leftMotor, float rightMotor, float leftTrigger, float rightTrigger)
  Parameters
playerIndexPlayerIndexPlayer index that identifies the controller to set.
leftMotorfloatThe speed of the left motor, between 0.0 and 1.0. This motor is a low-frequency motor.
rightMotorfloatThe speed of the right motor, between 0.0 and 1.0. This motor is a high-frequency motor.
leftTriggerfloat(Xbox One controller only) The speed of the left trigger motor, between 0.0 and 1.0. This motor is a high-frequency motor.
rightTriggerfloat(Xbox One controller only) The speed of the right trigger motor, between 0.0 and 1.0. This motor is a high-frequency motor.
Returns
- bool
 Returns true if the vibration motors were set.
SetVibration(int, float, float)
Sets the vibration motor speeds on the controller device if supported.
public static bool SetVibration(int index, float leftMotor, float rightMotor)
  Parameters
indexintIndex for the controller you want to query.
leftMotorfloatThe speed of the left motor, between 0.0 and 1.0. This motor is a low-frequency motor.
rightMotorfloatThe speed of the right motor, between 0.0 and 1.0. This motor is a high-frequency motor.
Returns
- bool
 Returns true if the vibration motors were set.
SetVibration(int, float, float, float, float)
Sets the vibration motor speeds on the controller device if supported.
public static bool SetVibration(int index, float leftMotor, float rightMotor, float leftTrigger, float rightTrigger)
  Parameters
indexintIndex for the controller you want to query.
leftMotorfloatThe speed of the left motor, between 0.0 and 1.0. This motor is a low-frequency motor.
rightMotorfloatThe speed of the right motor, between 0.0 and 1.0. This motor is a high-frequency motor.
leftTriggerfloat(Xbox One controller only) The speed of the left trigger motor, between 0.0 and 1.0. This motor is a high-frequency motor.
rightTriggerfloat(Xbox One controller only) The speed of the right trigger motor, between 0.0 and 1.0. This motor is a high-frequency motor.
Returns
- bool
 Returns true if the vibration motors were set.