GamepadReading.Buttons Property

Gets the button type.

Syntax

public:
property GamepadButtons Buttons {
         GamepadButtons get ();
}  

Property value

Type: GamepadButtons 

The button type.

Remarks

The Buttons property returns a GamepadButtons bit field that can have multiple bits set, representing currently pressed buttons.

The following code detects whether the A button is currently pressed.

    // Note: reading->Buttons returns a bit field that can have multiple bits set.
    if( ( reading->Buttons & GamepadButtons::A ) == GamepadButtons::A )
    {
        // Add game logic for A button currently pressed.
    }  

Note This is a cross-OS call. For more information, see Cross-OS Calls.

Requirements

Namespace: Windows.Xbox.Input
Metadata: windows.winmd

See also

Reference

GamepadButtons Enumeration
GamepadReading Class
GamepadReading Members
Windows.Xbox.Input Namespace