-api-id | -api-type |
---|---|
E:Windows.Gaming.Input.RawGameController.HeadsetDisconnected |
winrt event |
Signals when a headset is disconnected from the raw game controller.
For more information on detecting, tracking, and using headsets, see Headset.
Windows.Gaming.Input.IGameController, Windows.Gaming.Input.Headset
The following example shows how to register a handler for this event.
#include <winrt/Windows.Gaming.Input.h>
using namespace winrt;
using namespace Windows::Gaming::Input;
...
RawGameController m_rawGameController{ nullptr }; // Need to initialize this to a **RawGameController** that's connected to the device.
...
m_rawGameController.HeadsetDisconnected([this](IGameController const& /* sender */, Headset const& /* args */)
{
// Disable headset capture and playback on this device.
});
// `rawGameController` is a **RawGameController** that's connected to the device.
rawGameController.HeadsetDisconnected += ref new TypedEventHandler<IGameController^, Headset^>(
[] (IGameController^ device, Headset^ headset)
{
// DIsable headset capture and playback on this device.
});