共用方式為


LegacyGipGameControllerProvider.ExecuteCommand(DeviceCommand) 方法

定義

在舊版 GIP (遊戲輸入通訊協定) 頭戴式裝置上執行命令。

public:
 virtual void ExecuteCommand(DeviceCommand command) = ExecuteCommand;
void ExecuteCommand(DeviceCommand const& command);
public void ExecuteCommand(DeviceCommand command);
function executeCommand(command)
Public Sub ExecuteCommand (command As DeviceCommand)

參數

command
DeviceCommand

要執行的命令。

範例

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 應該只與您開發的硬體搭配使用。

適用於

另請參閱