GameControllerBatteryLevel Enum

Definition

The amount of battery remaining in the controller.

public enum class GameControllerBatteryLevel
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Gaming.Input.GamingInputPreviewContract, 131072)]
enum class GameControllerBatteryLevel
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Gaming.Input.GamingInputPreviewContract), 131072)]
public enum GameControllerBatteryLevel
var value = Windows.Gaming.Input.Preview.GameControllerBatteryLevel.unknown
Public Enum GameControllerBatteryLevel
Inheritance
GameControllerBatteryLevel
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

Critical 1

The battery level is very low.

Full 4

The battery is fully charged.

Low 2

The battery level is low.

Medium 3

The battery is partly charged.

Unknown 0

The battery level is unknown.

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