共用方式為


GameControllerBatteryKind 列舉

定義

控制器中的電池種類。

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
繼承
GameControllerBatteryKind
屬性

Windows 需求

裝置系列
Windows Desktop Extension SDK (已於 10.0.23665.0 引進)
API contract
Windows.Gaming.Input.GamingInputPreviewContract (已於 v2.0 引進)

欄位

None 1

控制器沒有電池。

Rechargeable 3

控制器具有可充電電池。

Standard 2

控制器具有不可充電的電池。

Unknown 0

電池的種類不明。

範例

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);
}

適用於