Last Update: Dec 2012
Gamepad Structure (SharpDX.XInput)
Describes the current state of the Xbox 360 Controller.
Assembly: SharpDX.XInput (SharpDX.XInput.dll 2.4.2.0)
Namespace: SharpDX.XInput
Unmanaged: XINPUT_GAMEPAD
Documentation for unmanaged references are generated from MSDN documentation. Please refer to the original documentation for further details.
Namespace: SharpDX.XInput
Unmanaged: XINPUT_GAMEPAD
Documentation for unmanaged references are generated from MSDN documentation. Please refer to the original documentation for further details.
- C#
- VB
- C++
- F#
[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 2)] public struct Gamepad
Syntax for VB is not yet implemented.
Syntax for C++ is not yet implemented
Syntax for F# is not yet implemented.
The Gamepad type exposes the following members.
| Platforms | Name | Unmanaged | Description | |
|---|---|---|---|---|
| TriggerThreshold | Constant TriggerThreshold. | |||
| LeftThumbDeadZone | Constant LeftThumbDeadZone. | |||
| RightThumbDeadZone | Constant RightThumbDeadZone. | |||
| Buttons | XINPUT_GAMEPAD_BUTTON_FLAGS wButtons | #define DPadUp 0x00000001 #define DPadDown 0x00000002 #define DPadLeft 0x00000004 #define DPadRight 0x00000008 #define Start 0x00000010 #define Back 0x00000020 #define LeftThumb 0x00000040 #define RightThumb 0x00000080 #define LeftShoulder 0x0100 #define RightShoulder 0x0200 #define A 0x1000 #define B 0x2000 #define X 0x4000 #define Y 0x8000 Bits that are set but not defined above are reserved, and their state is undefined. |
||
| LeftTrigger | unsigned char bLeftTrigger | |||
| RightTrigger | unsigned char bRightTrigger | |||
| LeftThumbX | short sThumbLX | |||
| LeftThumbY | short sThumbLY | |||
| RightThumbX | short sThumbRX | |||
| RightThumbY | short sThumbRY |
| Platforms | Name | Description | |
|---|---|---|---|
| ToString | Returns the fully qualified type name of this instance. (Overrides ValueType.ToString()) |
This structure is used by the State structure when polling for changes in the state of the controller.
The specific mapping of button to game function varies depending on the game type.
The constant XINPUT_GAMEPAD_TRIGGER_THRESHOLD may be used as the value which bLeftTrigger and bRightTrigger must be greater than to register as pressed. This is optional, but often desirable. Xbox 360 Controller buttons do not manifest crosstalk.
Supported in: All Windows Desktop - .NET 2.0+ - .NET 4.0+
Windows 8 Metro - DirectX11.1 - .NET 4.5 Core
Windows 8 Desktop - DirectX11.1 - .NET 4.0+
Windows 8 Metro - DirectX11.1 - .NET 4.5 Core
Windows 8 Desktop - DirectX11.1 - .NET 4.0+