Class GamePad
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.
Inheritance
Inherited Members
Namespace: OpenTK.Input
Assembly: cs.temp.dll.dll
Syntax
public sealed class GamePad
Methods
GetCapabilities(Int32)
Retrieves a GamePadCapabilities
structure describing the
capabilities of a gamepad device.
Declaration
public static GamePadCapabilities GetCapabilities(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The zero-based index of a gamepad device. |
Returns
Type | Description |
---|---|
GamePadCapabilities | A |
GetName(Int32)
Gets the name of this GamePad
Declaration
public static string GetName(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | A zero-based device index for the |
Returns
Type | Description |
---|---|
System.String | Returns the name of the gamepad if the gamepad is connected. Otherwise returns an empty string. |
GetState(Int32)
Retrieves the GamePadState
for the specified gamepad device.
Declaration
public static GamePadState GetState(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The zero-based index of a gamepad device. |
Returns
Type | Description |
---|---|
GamePadState | A |
SetVibration(Int32, Single, Single)
Sets the vibration intensity for the left and right motors of this GamePad
Declaration
public static bool SetVibration(int index, float left, float right)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | A zero-based device index for the |
System.Single | left | The vibration intensity for the left motor, between 0.0 and 1.0. |
System.Single | right | The vibration intensity for the right motor, between 0.0 and 1.0. |
Returns
Type | Description |
---|---|
System.Boolean |
|