MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ filter_matches()

bool MayaFlux::Kriya::EventAwaiter::filter_matches ( const Core::WindowEvent event) const
private

Definition at line 44 of file EventAwaiter.cpp.

45{
46 if (m_filter.event_type && event.type != *m_filter.event_type)
47 return false;
48 if (m_filter.key_code) {
49 auto* kd = std::get_if<Core::WindowEvent::KeyData>(&event.data);
50 if (!kd || kd->key != static_cast<int16_t>(*m_filter.key_code))
51 return false;
52 }
53 if (m_filter.button) {
54 auto* bd = std::get_if<Core::WindowEvent::MouseButtonData>(&event.data);
55 if (!bd || bd->button != static_cast<int>(*m_filter.button))
56 return false;
57 }
58 return true;
59}
std::optional< IO::Keys > key_code
std::optional< IO::MouseButtons > button
std::optional< Core::WindowEventType > event_type

References MayaFlux::Vruta::EventFilter::button, MayaFlux::Core::WindowEvent::data, MayaFlux::Vruta::EventFilter::event_type, MayaFlux::Vruta::EventFilter::key_code, m_filter, and MayaFlux::Core::WindowEvent::type.

Referenced by MayaFlux::Vruta::EventSource::signal().

+ Here is the caller graph for this function: