Skip to content

Latest commit

 

History

History
48 lines (36 loc) · 1.41 KB

rawgamecontroller_headsetdisconnected.md

File metadata and controls

48 lines (36 loc) · 1.41 KB
-api-id -api-type
E:Windows.Gaming.Input.RawGameController.HeadsetDisconnected
winrt event

Windows.Gaming.Input.RawGameController.HeadsetDisconnected

-description

Signals when a headset is disconnected from the raw game controller.

-remarks

For more information on detecting, tracking, and using headsets, see Headset.

-see-also

Windows.Gaming.Input.IGameController, Windows.Gaming.Input.Headset

-examples

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