Table of Contents

Struct GamePadState

Namespace
Stride.Input
Assembly
Stride.Input.dll

Describes the state of a typical gamepad.

public struct GamePadState : IEquatable<GamePadState>
Implements

Fields

Buttons

Bitmask of the gamepad buttons.

public GamePadButton Buttons

Field Value

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

Vector2

LeftTrigger

The left trigger analog control in the range [0, 1.0f]. See remarks.

public float LeftTrigger

Field Value

float

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

Vector2

RightTrigger

The right trigger analog control in the range [0, 1.0f]. See remarks.

public float RightTrigger

Field Value

float

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

other GamePadState

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

Update(GamePadAxisEvent)

Updates the state from any gamepad events received that have mapped buttons

public bool Update(GamePadAxisEvent axisEvent)

Parameters

axisEvent GamePadAxisEvent

The gamepad event to process

Returns

bool

true if the event made any changes

Update(GamePadButtonEvent)

Updates the state from any gamepad events received that have mapped buttons

public bool Update(GamePadButtonEvent buttonEvent)

Parameters

buttonEvent GamePadButtonEvent

The gamepad event to process

Returns

bool

true if the event made any changes

Update(InputEvent)

Updates the state from any gamepad events received that have mapped buttons

public bool Update(InputEvent evt)

Parameters

evt InputEvent

The gamepad event to process

Returns

bool

true if the event made any changes

Operators

operator ==(GamePadState, GamePadState)

Implements the == operator.

public static bool operator ==(GamePadState left, GamePadState right)

Parameters

left GamePadState

The left gamepad value.

right GamePadState

The right gamepad value.

Returns

bool

The result of the operator.

operator !=(GamePadState, GamePadState)

Implements the != operator.

public static bool operator !=(GamePadState left, GamePadState right)

Parameters

left GamePadState

The left gamepad value.

right GamePadState

The right gamepad value.

Returns

bool

The result of the operator.

See Also