Gamepad Gamepad Gamepad Gamepad Gamepad Class


Represents a gamepad.

public : sealed class Gamepad : IGameController, IGameControllerBatteryInfo
struct winrt::Windows::Gaming::Input::Gamepad : IGameController, IGameControllerBatteryInfo
public sealed class Gamepad : IGameController, IGameControllerBatteryInfo
Public NotInheritable Class Gamepad Implements IGameController, IGameControllerBatteryInfo
// This class does not provide a public constructor.

Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)


The following code snippet shows how to loop through the Gamepad.Gamepads list and add each one to a vector. You'll need to put a lock on the vector, because things can change at any time (a controller might be disconnected or reconnected, for example).

auto myGamepads = ref new Vector<Gamepad^>();
critical_section myLock{};

for (auto gamepad : Gamepad::Gamepads)
    // Check if the gamepad is already in myGamepads; if it isn't, add it.
    critical_section::scoped_lock lock{ myLock };
    auto it = std::find(begin(myGamepads), end(myGamepads), gamepad);

    if (it == end(myGamepads))
        // This code assumes that you're interested in all gamepads.


Instances of the Gamepad class cannot be created directly; instead, instances of the Gamepad class are retrieved through the Gamepad.Gamepads property listing all connected gamepads or through the Gamepad.GamepadAdded event.

Supported Devices

Gamepad supports any Xbox One certified or Xbox 360 compatible gamepad.

Version history

Windows version SDK version Value added
1607 14393 GetButtonLabel
1703 15063 FromGameController
1703 15063 TryGetBatteryReport


Gamepads Gamepads Gamepads Gamepads Gamepads

The list of all connected gamepads.

Headset Headset Headset Headset Headset

The audio headset attached to the gamepad.

IsWireless IsWireless IsWireless IsWireless IsWireless

Gets a value that indicates the wireless state of the gamepad.

User User User User User

The user associated with the gamepad.

Vibration Vibration Vibration Vibration Vibration

Describes the gamepad motor speed.


FromGameController(IGameController) FromGameController(IGameController) FromGameController(IGameController) FromGameController(IGameController) FromGameController(IGameController)

Returns the given game controller as a gamepad.

GetButtonLabel(GamepadButtons) GetButtonLabel(GamepadButtons) GetButtonLabel(GamepadButtons) GetButtonLabel(GamepadButtons) GetButtonLabel(GamepadButtons)

Retrieves the button label for the specified button.

GetCurrentReading() GetCurrentReading() GetCurrentReading() GetCurrentReading() GetCurrentReading()

Gets a snapshot of the gamepad state.

TryGetBatteryReport() TryGetBatteryReport() TryGetBatteryReport() TryGetBatteryReport() TryGetBatteryReport()

Gets information about the gamepad's current battery state.


GamepadAdded GamepadAdded GamepadAdded GamepadAdded GamepadAdded

Signals when a new gamepad is connected.

GamepadRemoved GamepadRemoved GamepadRemoved GamepadRemoved GamepadRemoved

Signals when a gamepad is disconnected.

HeadsetConnected HeadsetConnected HeadsetConnected HeadsetConnected HeadsetConnected

Signals when a headset is attached to the gamepad.

HeadsetDisconnected HeadsetDisconnected HeadsetDisconnected HeadsetDisconnected HeadsetDisconnected

Signals when a headset is disconnected from the gamepad.

UserChanged UserChanged UserChanged UserChanged UserChanged

Signals when the user associated with the gamepad has changed.

See also