GamePadState Struct
Namespace: Stride.InputAssembly: Stride.Input.dll
Describes the state of a typical gamepad.
public struct GamePadState : IEquatable<GamePadState>
Name | Description | |
---|---|---|
Fields | ||
Buttons | Bitmask of the gamepad buttons. |
|
LeftThumb | Left thumbstick x-axis/y-axis value. The value is in the range [-1.0f, 1.0f] for both axis. |
|
LeftTrigger | The left trigger analog control in the range [0, 1.0f]. See remarks. |
|
RightThumb | Right thumbstick x-axis/y-axis value. The value is in the range [-1.0f, 1.0f] for both axis. |
|
RightTrigger | The right trigger analog control in the range [0, 1.0f]. See remarks. |
|
Methods | ||
Equals(GamePadState) | Indicates whether the current object is equal to another object of the same type. |
|
Equals(Object) | ||
GetHashCode() | ||
ToString() | ||
Update(GamePadAxisEvent) | Updates the state from any gamepad events received that have mapped buttons |
|
Update(GamePadButtonEvent) | Updates the state from any gamepad events received that have mapped buttons |
|
Update(InputEvent) | Updates the state from any gamepad events received that have mapped buttons |
|
Operators | ||
Equality(GamePadState, GamePadState) | Implements the == operator. |
|
Inequality(GamePadState, GamePadState) | Implements the != operator. |
Fields
Buttons
Bitmask of the gamepad buttons.
public GamePadButton Buttons
Field Value
Type | Description |
---|---|
GamePadButton |
LeftThumb
Left thumbstick x-axis/y-axis value. The value is in the range [-1.0f, 1.0f] for both axis.
public Vector2 LeftThumb
Field Value
Type | Description |
---|---|
Vector2 |
LeftTrigger
The left trigger analog control in the range [0, 1.0f]. See remarks.
public float LeftTrigger
Field Value
Type | Description |
---|---|
System.Single |
Remarks
Some controllers are not supporting the range of value and may act as a simple button returning only 0 or 1.
RightThumb
Right thumbstick x-axis/y-axis value. The value is in the range [-1.0f, 1.0f] for both axis.
public Vector2 RightThumb
Field Value
Type | Description |
---|---|
Vector2 |
RightTrigger
The right trigger analog control in the range [0, 1.0f]. See remarks.
public float RightTrigger
Field Value
Type | Description |
---|---|
System.Single |
Remarks
Some controllers are not supporting the range of value and may act as a simple button returning only 0 or 1.
Methods
Equals(GamePadState)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(GamePadState other)
Parameters
Type | Name | Description |
---|---|---|
GamePadState | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
System.Boolean | true if the current object is equal to the |
Equals(Object)
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
GetHashCode()
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
ToString()
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Overrides
Update(GamePadAxisEvent)
Updates the state from any gamepad events received that have mapped buttons
public bool Update(GamePadAxisEvent axisEvent)
Parameters
Type | Name | Description |
---|---|---|
GamePadAxisEvent | axisEvent | The gamepad event to process |
Returns
Type | Description |
---|---|
System.Boolean |
|
Update(GamePadButtonEvent)
Updates the state from any gamepad events received that have mapped buttons
public bool Update(GamePadButtonEvent buttonEvent)
Parameters
Type | Name | Description |
---|---|---|
GamePadButtonEvent | buttonEvent | The gamepad event to process |
Returns
Type | Description |
---|---|
System.Boolean |
|
Update(InputEvent)
Updates the state from any gamepad events received that have mapped buttons
public bool Update(InputEvent evt)
Parameters
Type | Name | Description |
---|---|---|
InputEvent | evt | The gamepad event to process |
Returns
Type | Description |
---|---|
System.Boolean |
|
Operators
Equality(GamePadState, GamePadState)
Implements the == operator.
public static bool operator ==(GamePadState left, GamePadState right)
Parameters
Type | Name | Description |
---|---|---|
GamePadState | left | The left gamepad value. |
GamePadState | right | The right gamepad value. |
Returns
Type | Description |
---|---|
System.Boolean | The result of the operator. |
Inequality(GamePadState, GamePadState)
Implements the != operator.
public static bool operator !=(GamePadState left, GamePadState right)
Parameters
Type | Name | Description |
---|---|---|
GamePadState | left | The left gamepad value. |
GamePadState | right | The right gamepad value. |
Returns
Type | Description |
---|---|
System.Boolean | The result of the operator. |