54 const auto* kd = std::get_if<Core::WindowEvent::KeyData>(&ev->data);
60 const auto* bd = std::get_if<Core::WindowEvent::MouseButtonData>(&ev->data);
std::coroutine_handle m_handle
bool filter_matches(const void *event) const override
Casts event to Core::WindowEvent and checks against stored filter.
void await_suspend(std::coroutine_handle<> handle)
Registers with the source and suspends the coroutine.
Core::WindowEvent await_resume()
Returns the event that caused resumption.
bool await_ready()
Returns true if a matching event is already queued; stores it if so.
void try_resume(const void *event) override
Casts event to Core::WindowEvent, checks filter, resumes if matched.
~WindowEventAwaiter() override
Core::WindowEvent m_result
Vruta::WindowEventFilter m_filter
Vruta::WindowEventSource & m_source
void register_waiter(Kriya::EventAwaiter *awaiter)
void unregister_waiter(Kriya::EventAwaiter *awaiter)
std::optional< Core::WindowEvent > pop_event(const WindowEventFilter &filter)
Removes and returns the first pending event matching the filter.
Event data for window and input events.
std::optional< IO::Keys > key_code
std::optional< Core::WindowEventType > event_type
std::optional< IO::MouseButtons > button