Table of Contents

Struct GamePadButtons

Namespace
Microsoft.Xna.Framework.Input
Assembly
MonoGame.Framework.dll

A struct that represents the current button states for the controller.

public struct GamePadButtons
Inherited Members

Constructors

GamePadButtons(Buttons)

Initializes a new instance of the GamePadButtons structure, setting the specified buttons to pressed in.

public GamePadButtons(Buttons buttons)

Parameters

buttons Buttons

Buttons to be set as pressed in.

Properties

A

Gets a value indicating if the button A is pressed.

public ButtonState A { get; }

Property Value

ButtonState

Pressed if the button A is pressed; otherwise, Released.

B

Gets a value indicating if the button B is pressed.

public ButtonState B { get; }

Property Value

ButtonState

Pressed if the button B is pressed; otherwise, Released.

Back

Gets a value indicating if the button Back is pressed.

public ButtonState Back { get; }

Property Value

ButtonState

Pressed if the button Back is pressed; otherwise, Released.

BigButton

Gets a value indicating if the guide button is pressed.

public ButtonState BigButton { get; }

Property Value

ButtonState

Pressed if the guide button is pressed; otherwise, Released.

LeftShoulder

Gets a value indicating if the left shoulder button is pressed.

public ButtonState LeftShoulder { get; }

Property Value

ButtonState

Pressed if the left shoulder button is pressed; otherwise, Released.

LeftStick

Gets a value indicating if the left stick button is pressed.

public ButtonState LeftStick { get; }

Property Value

ButtonState

Pressed if the left stick button is pressed; otherwise, Released.

RightShoulder

Gets a value indicating if the right shoulder button is pressed.

public ButtonState RightShoulder { get; }

Property Value

ButtonState

Pressed if the right shoulder button is pressed; otherwise, Released.

RightStick

Gets a value indicating if the right stick button is pressed.

public ButtonState RightStick { get; }

Property Value

ButtonState

Pressed if the right stick button is pressed; otherwise, Released.

Start

Gets a value indicating if the button Start is pressed.

public ButtonState Start { get; }

Property Value

ButtonState

Pressed if the button Start is pressed; otherwise, Released.

X

Gets a value indicating if the button X is pressed.

public ButtonState X { get; }

Property Value

ButtonState

Pressed if the button X is pressed; otherwise, Released.

Y

Gets a value indicating if the button Y is pressed.

public ButtonState Y { get; }

Property Value

ButtonState

Pressed if the button Y is pressed; otherwise, Released.

Methods

Equals(object)

Returns a value indicating whether this instance is equal to a specified object.

public override bool Equals(object obj)

Parameters

obj object

An object to compare to this instance.

Returns

bool

true if obj is a GamePadButtons and has the same value as this instance; otherwise, false.

GetHashCode()

Serves as a hash function for a GamePadButtons object.

public override int GetHashCode()

Returns

int

A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a hash table.

ToString()

Returns a string that represents the current GamePadButtons.

public override string ToString()

Returns

string

A string that represents the current GamePadButtons.

Operators

operator ==(GamePadButtons, GamePadButtons)

Determines whether two specified instances of GamePadButtons are equal.

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

Parameters

left GamePadButtons

The first object to compare.

right GamePadButtons

The second object to compare.

Returns

bool

true if left and right are equal; otherwise, false.

operator !=(GamePadButtons, GamePadButtons)

Determines whether two specified instances of GamePadButtons are not equal.

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

Parameters

left GamePadButtons

The first object to compare.

right GamePadButtons

The second object to compare.

Returns

bool

true if left and right are not equal; otherwise, false.