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

◆ dispatch()

void MayaFlux::Portal::Forma::Context::dispatch ( uint32_t id,
Core::WindowEventType type,
glm::vec2 ndc,
Core::WindowEvent::EventData data = {},
std::optional< IO::MouseButtons > button = std::nullopt,
std::optional< IO::Keys > key = std::nullopt )
private

Definition at line 728 of file Context.cpp.

731{
732 const auto found = m_callbacks.find(id);
733 if (found == m_callbacks.end())
734 return;
735
736 const auto subscribers = found->second.subscribers;
737 Core::WindowEvent event;
738 event.type = type;
739 event.data = std::move(data);
740 for (const auto& subscription : subscribers) {
741 if (matches(subscription.filter, type, button, key, event.data))
742 subscription.fn(id, event, ndc);
743 }
744}
std::unordered_map< uint32_t, ElementCallbacks > m_callbacks
Definition Context.hpp:471

References MayaFlux::Core::WindowEvent::data, m_callbacks, and MayaFlux::Core::WindowEvent::type.

Referenced by handle_drag(), handle_move(), handle_press(), handle_release(), handle_scroll(), handle_subscribed_key(), handle_text(), and move_focus().

Here is the caller graph for this function: