Freigeben über


FlightStick.HeadsetDisconnected Ereignis

Definition

Signalisiert, wenn ein Headset vom FlightStick getrennt ist.

// 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

Ereignistyp

Implementiert

Beispiele

Das folgende Beispiel zeigt, wie Sie einen Handler für dieses Ereignis registrieren.

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

Hinweise

Weitere Informationen zum Erkennen, Nachverfolgen und Verwenden von Headsets finden Sie unter Headset.

Gilt für:

Weitere Informationen