The Open Toolkit library  1.1
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Static Public Member Functions | List of all members
OpenTK.Input.GamePad Class Reference

Provides access to GamePad devices. A GamePad device offers a well-defined layout with one direction-pad, two thumbsticks, two triggers, four main buttons (A, B, X, Y) and up to seven auxilliary buttons. Use GetCapabilities to retrieve the exact capabilities of a given device. Use GetState to retrieve the current state of a given device. More...

Static Public Member Functions

static GamePadCapabilities GetCapabilities (int index)
 Retrieves a GamePadCapabilities structure describing the capabilities of a gamepad device. More...
 
static GamePadState GetState (int index)
 Retrieves the GamePadState for the specified gamepad device. More...
 
static bool SetVibration (int index, float left, float right)
 Sets the vibration intensity for the left and right motors of this GamePad More...
 

Detailed Description

Provides access to GamePad devices. A GamePad device offers a well-defined layout with one direction-pad, two thumbsticks, two triggers, four main buttons (A, B, X, Y) and up to seven auxilliary buttons. Use GetCapabilities to retrieve the exact capabilities of a given device. Use GetState to retrieve the current state of a given device.

Member Function Documentation

static GamePadCapabilities OpenTK.Input.GamePad.GetCapabilities ( int  index)
static

Retrieves a GamePadCapabilities structure describing the capabilities of a gamepad device.

Parameters
indexThe zero-based index of a gamepad device.
Returns
A GamePadCapabilities structure describing the capabilities of the gamepad device.
static GamePadState OpenTK.Input.GamePad.GetState ( int  index)
static

Retrieves the GamePadState for the specified gamepad device.

Parameters
indexThe zero-based index of a gamepad device.
Returns
A GamePadState structure describing the state of the gamepad device.
static bool OpenTK.Input.GamePad.SetVibration ( int  index,
float  left,
float  right 
)
static

Sets the vibration intensity for the left and right motors of this GamePad

Returns
true, if vibration was set, false otherwise. This method can return false if the GamePad hardware does not support vibration or if it cannot respond to the command for any reason. Do not loop until this becomes true, but rather ignore a return value of false.
Parameters
indexA zero-based device index for the GamePad device to affect
leftThe vibration intensity for the left motor, between 0.0 and 1.0.
rightThe vibration intensity for the right motor, between 0.0 and 1.0.