RawGameController.GetButtonLabel(Int32) Method

Definition

Retrieves the button label for the specified button.

public:
 virtual GameControllerButtonLabel GetButtonLabel(int buttonIndex) = GetButtonLabel;
GameControllerButtonLabel GetButtonLabel(int const& buttonIndex);
public GameControllerButtonLabel GetButtonLabel(int buttonIndex);
function getButtonLabel(buttonIndex)
Public Function GetButtonLabel (buttonIndex As Integer) As GameControllerButtonLabel

Parameters

buttonIndex
Int32

int

The button for which to retrieve the label.

Returns

GameControllerButtonLabel

The label for the specified button. If the button label is blank or there is no known label for the controller's button, then None is returned.

Remarks

Unlike the GetButtonLabel member functions of other classes, such as ArcadeStick.GetButtonLabel, this function takes an integer, rather than an ArcadeStickButtons or other enumeration value. This integer is an index into the buttons array for the raw game controller.

You can create your own buttons array and then populate it with values representing each button's state using RawGameController.GetCurrentReading. See Raw game controller for more information.

Applies to

See also