Share via


GameControllerBatteryKind Enum

Definition

The kind of battery in the controller.

public enum class GameControllerBatteryKind
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Gaming.Input.GamingInputPreviewContract, 131072)]
enum class GameControllerBatteryKind
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Gaming.Input.GamingInputPreviewContract), 131072)]
public enum GameControllerBatteryKind
var value = Windows.Gaming.Input.Preview.GameControllerBatteryKind.unknown
Public Enum GameControllerBatteryKind
Inheritance
GameControllerBatteryKind
Attributes

Windows requirements

Device family
Windows Desktop Extension SDK (introduced in 10.0.23665.0)
API contract
Windows.Gaming.Input.GamingInputPreviewContract (introduced in v2.0)

Fields

Name Value Description
Unknown 0

The kind of battery is unknown.

None 1

The controller does not have a battery.

Standard 2

The controller has a non-rechargeable battery.

Rechargeable 3

The controller has a rechargeable battery.

Examples

public void SetupHeadset(IGameControllerProvider headsetProvider)
{
    LegacyGipGameControllerProvider legacyGipGameControllerProvider =
        LegacyGipGameControllerProvider.FromGameControllerProvider(headsetProvider);

    // Reset the device
    legacyGipGameControllerProvider.ExecuteCommand(DeviceCommand.Reset);

    // Check the smart mute level
    byte[] smartMuteBuffer =
        legacyGipGameControllerProvider.GetHeadsetOperation(HeadsetOperation.SmartMute);
    HeadsetLevel smartMuteValue = (HeadsetLevel)smartMuteBuffer[0];

    // Set bass boost to 3db
    byte[] bassBuffer = BitConverter.GetBytes((UInt32)3);
    legacyGipGameControllerProvider.SetHeadsetOperation(HeadsetOperation.BassBoostGain,
        bassBuffer);
}

Applies to