Struct GamePadState
Describes the state of a typical gamepad.
public struct GamePadState : IEquatable<GamePadState>- Implements
Fields
Buttons
Bitmask of the gamepad buttons.
public GamePadButton ButtonsField Value
LeftThumb
Left thumbstick x-axis/y-axis value. The value is in the range [-1.0f, 1.0f] for both axis.
public Vector2 LeftThumbField Value
LeftTrigger
The left trigger analog control in the range [0, 1.0f]. See remarks.
public float LeftTriggerField Value
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 RightThumbField Value
RightTrigger
The right trigger analog control in the range [0, 1.0f]. See remarks.
public float RightTriggerField Value
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
- otherGamePadState
- An object to compare with this object. 
Returns
- bool
- true if the current object is equal to the - otherparameter; otherwise, false.
Equals(object)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object obj)Parameters
- objobject
- The object to compare with the current instance. 
Returns
- bool
- true if - objand 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
- axisEventGamePadAxisEvent
- The gamepad event to process 
Returns
- bool
- trueif 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
- buttonEventGamePadButtonEvent
- The gamepad event to process 
Returns
- bool
- trueif 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
- evtInputEvent
- The gamepad event to process 
Returns
- bool
- trueif the event made any changes
Operators
operator ==(GamePadState, GamePadState)
Implements the == operator.
public static bool operator ==(GamePadState left, GamePadState right)Parameters
- leftGamePadState
- The left gamepad value. 
- rightGamePadState
- 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
- leftGamePadState
- The left gamepad value. 
- rightGamePadState
- The right gamepad value. 
Returns
- bool
- The result of the operator.