GameControllerBatteryChargingState 列舉
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
控制器的電池充電狀態。
public enum class GameControllerBatteryChargingState
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Gaming.Input.GamingInputPreviewContract, 131072)]
enum class GameControllerBatteryChargingState
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Gaming.Input.GamingInputPreviewContract), 131072)]
public enum GameControllerBatteryChargingState
var value = Windows.Gaming.Input.Preview.GameControllerBatteryChargingState.unknown
Public Enum GameControllerBatteryChargingState
- 繼承
-
GameControllerBatteryChargingState
- 屬性
Windows 需求
裝置系列 |
Windows Desktop Extension SDK (已於 10.0.23665.0 引進)
|
API contract |
Windows.Gaming.Input.GamingInputPreviewContract (已於 v2.0 引進)
|
欄位
Active | 2 | 電池正在充電。 |
Error | 3 | 控制器回報了充電錯誤。 |
Inactive | 1 | 電池未充電。 |
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);
}