다음을 통해 공유


FlightStick.FlightStickRemoved 이벤트

정의

비행 스틱의 연결이 끊어지면 신호를 보냅니다.

// Register
static event_token FlightStickRemoved(EventHandler<FlightStick> const& handler) const;

// Revoke with event_token
static void FlightStickRemoved(event_token const* cookie) const;

// Revoke with event_revoker
static FlightStick::FlightStickRemoved_revoker FlightStickRemoved(auto_revoke_t, EventHandler<FlightStick> const& handler) const;
public static event System.EventHandler<FlightStick> FlightStickRemoved;
function onFlightStickRemoved(eventArgs) { /* Your code */ }
Windows.Gaming.Input.FlightStick.addEventListener("flightstickremoved", onFlightStickRemoved);
Windows.Gaming.Input.FlightStick.removeEventListener("flightstickremoved", onFlightStickRemoved);
- or -
Windows.Gaming.Input.FlightStick.onflightstickremoved = onFlightStickRemoved;
Public Shared Custom Event FlightStickRemoved As EventHandler(Of FlightStick) 

이벤트 유형

설명

다음 예제에서는 제거된 비행 스틱 추적을 중지합니다.

#include <algorithm>
#include <winrt/Windows.Gaming.Input.h>
using namespace winrt;
using namespace Windows::Gaming::Input;
...
std::vector<FlightStick> m_myFlightSticks;
...
FlightStick::FlightStickRemoved([this](IInspectable const& /* sender */, FlightStick const& args)
    {
        std::remove(m_myFlightSticks.begin(), m_myFlightSticks.end(), args);
    });
FlightStick::FlightStickRemoved += 
    ref new EventHandler<FlightStick^>([] (Platform::Object^, FlightStick^ args)
{
    unsigned int indexRemoved;

    // `myFlightSticks` is a `Vector<FlightStick^>` that contains the flight sticks that your game is tracking.

    if (myFlightSticks->IndexOf(args, &indexRemoved))
    {
        myFlightSticks->RemoveAt(indexRemoved);
    }
});

적용 대상