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