DeviceCommand 枚举

定义

可在 GIP (游戏输入协议) 头戴显示设备上执行的命令。

public enum class DeviceCommand
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Gaming.Input.GamingInputPreviewContract, 131072)]
enum class DeviceCommand
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Gaming.Input.GamingInputPreviewContract), 131072)]
public enum DeviceCommand
var value = Windows.Gaming.Input.Preview.DeviceCommand.reset
Public Enum DeviceCommand
继承
DeviceCommand
属性

Windows 要求

设备系列
Windows Desktop Extension SDK (在 10.0.23665.0 中引入)
API contract
Windows.Gaming.Input.GamingInputPreviewContract (在 v2.0 中引入)

字段

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

注解

注意

为了避免损坏设备,头戴显示设备控制 API 应仅用于你开发的硬件。

适用于