FlightStick.HeadsetDisconnected 이벤트

정의

헤드셋이 플라이트 스틱에서 연결이 끊어지면 신호를 보냅니다.

// Register
event_token HeadsetDisconnected(TypedEventHandler<IGameController, Headset const&> const& handler) const;

// Revoke with event_token
void HeadsetDisconnected(event_token const* cookie) const;

// Revoke with event_revoker
FlightStick::HeadsetDisconnected_revoker HeadsetDisconnected(auto_revoke_t, TypedEventHandler<IGameController, Headset const&> const& handler) const;
public event TypedEventHandler<IGameController,Headset> HeadsetDisconnected;
function onHeadsetDisconnected(eventArgs) { /* Your code */ }
flightStick.addEventListener("headsetdisconnected", onHeadsetDisconnected);
flightStick.removeEventListener("headsetdisconnected", onHeadsetDisconnected);
- or -
flightStick.onheadsetdisconnected = onHeadsetDisconnected;
Public Custom Event HeadsetDisconnected As TypedEventHandler(Of IGameController, Headset) Implements HeadsetDisconnected

이벤트 유형

구현

예제

다음 예제에서는 이 이벤트에 대한 처리기를 등록하는 방법을 보여 있습니다.

#include <winrt/Windows.Gaming.Input.h>
using namespace winrt;
using namespace Windows::Gaming::Input;
...
FlightStick m_flightStick{ nullptr }; // Need to initialize this to a **FlightStick** that's connected to the device.
...
m_flightStick.HeadsetDisconnected([this](IGameController const& /* sender */, Headset const& /* args */)
    {
        // Disable headset capture and playback on this device.
    });
// `flightStick` is a **FlightStick** that's connected to the device.
flightStick.HeadsetDisconnected += ref new TypedEventHandler<IGameController^, Headset^>(
    [] (IGameController^ device, Headset^ headset)
{
    // Disable headset capture and playback on this device.
});

설명

헤드셋 검색, 추적 및 사용에 대한 자세한 내용은 헤드셋을 참조 하세요.

적용 대상

추가 정보