Struct GamePadState
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
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
LeftTrigger
The left trigger analog control in the range [0, 1.0f]. See remarks.
public float LeftTrigger
Field 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 RightThumb
Field Value
RightTrigger
The right trigger analog control in the range [0, 1.0f]. See remarks.
public float RightTrigger
Field 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
other
GamePadStateAn 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
objectThe 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
GamePadAxisEventThe 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
GamePadButtonEventThe 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
InputEventThe 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
GamePadStateThe left gamepad value.
right
GamePadStateThe 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
GamePadStateThe left gamepad value.
right
GamePadStateThe right gamepad value.
Returns
- bool
The result of the operator.