Microsoft.Xna.Framework.Input
Class GamePad

java.lang.Object
  extended by Microsoft.Xna.Framework.Input.GamePad

public class GamePad
extends java.lang.Object

Allows retrieval of user interaction with an Xbox 360 Controller and setting of controller vibration motors.

Author:
Halofreak1990

Constructor Summary
GamePad()
           
 
Method Summary
static GamePadCapabilities GetCapabilities(PlayerIndex playerIndex)
          Retrieves the capabilities of an Xbox 360 Controller.
static GamePadState GetState(PlayerIndex playerIndex)
          Gets the current state of an Xbox 360 Controller.
static GamePadState GetState(PlayerIndex playerIndex, GamePadDeadZone deadZoneMode)
          Gets the current state of an Xbox 360 Controller, using a specified dead zone on analog stick positions.
static boolean SetVibration(PlayerIndex playerIndex, float leftMotor, float rightMotor)
          Sets the vibration motor speeds on an Xbox 360 Controller.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GamePad

public GamePad()
Method Detail

GetCapabilities

public static GamePadCapabilities GetCapabilities(PlayerIndex playerIndex)
Retrieves the capabilities of an Xbox 360 Controller.

Parameters:
playerIndex - Index of the controller to query.
Returns:
The capabilities of the controller.

GetState

public static GamePadState GetState(PlayerIndex playerIndex)
Gets the current state of an Xbox 360 Controller.

Parameters:
playerIndex - Player index for the controller you want to query.
Returns:
The current state of the controller.

GetState

public static GamePadState GetState(PlayerIndex playerIndex,
                                    GamePadDeadZone deadZoneMode)
Gets the current state of an Xbox 360 Controller, using a specified dead zone on analog stick positions.

Parameters:
playerIndex - Player index for the controller you want to query.
deadZoneMode - Enumerated value that specifies what dead zone type to use.
Returns:
The current state of the controller.

SetVibration

public static boolean SetVibration(PlayerIndex playerIndex,
                                   float leftMotor,
                                   float rightMotor)
Sets the vibration motor speeds on an Xbox 360 Controller. Reference page contains links to related code samples.

Parameters:
playerIndex - Player index that identifies the controller to set.
leftMotor - The speed of the left motor, between 0.0 and 1.0. This motor is a low-frequency motor.
rightMotor - The speed of the right motor, between 0.0 and 1.0. This motor is a high-frequency motor.
Returns:
true if successful, false otherwise.