IGamePadDevice Interface
Namespace: Stride.InputAssembly: Stride.Input.dll
A gamepad is a game controller that has a fixed button mapping, stored in State
public interface IGamePadDevice : IInputDevice
| Name | Description | |
|---|---|---|
| Properties | ||
| CanChangeIndex |
|
|
| DownButtons | The gamepad buttons that are down |
|
| Index | The index of the gamepad assigned by the input manager |
|
| PressedButtons | The gamepad buttons that have been pressed since the last frame |
|
| ProductId | Product Id of the device |
|
| ReleasedButtons | The gamepad buttons that have been released since the last frame |
|
| State | The state of the gamepad |
|
| Methods | ||
| SetVibration(Single, Single, Single, Single) | Sets 4 vibration motors one the device or approximates the effect if less are supported |
|
| Events | ||
| IndexChanged | Raised if the index assigned to this gamepad changed |
|
Properties
CanChangeIndex
true if the index of this gamepad can be changed
bool CanChangeIndex { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
DownButtons
The gamepad buttons that are down
IReadOnlySet<GamePadButton> DownButtons { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlySet<GamePadButton> |
Index
The index of the gamepad assigned by the input manager
int Index { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Remarks
If CanChangeIndex is false, this value can not be changed
PressedButtons
The gamepad buttons that have been pressed since the last frame
IReadOnlySet<GamePadButton> PressedButtons { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlySet<GamePadButton> |
ProductId
Product Id of the device
Guid ProductId { get; }
Property Value
| Type | Description |
|---|---|
| System.Guid |
ReleasedButtons
The gamepad buttons that have been released since the last frame
IReadOnlySet<GamePadButton> ReleasedButtons { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlySet<GamePadButton> |
State
The state of the gamepad
GamePadState State { get; }
Property Value
| Type | Description |
|---|---|
| GamePadState |
Methods
SetVibration(Single, Single, Single, Single)
Sets 4 vibration motors one the device or approximates the effect if less are supported
void SetVibration(float smallLeft, float smallRight, float largeLeft, float largeRight)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | smallLeft | The small left side motor |
| System.Single | smallRight | The small right side motor |
| System.Single | largeLeft | The large left side motor |
| System.Single | largeRight | The large right side motor |
Remarks
Values range from 0 to 1, where 0 is off and 1 is maximum vibration
Events
IndexChanged
Raised if the index assigned to this gamepad changed
event EventHandler<GamePadIndexChangedEventArgs> IndexChanged
Event Type
| Type | Description |
|---|---|
| System.EventHandler<GamePadIndexChangedEventArgs> |