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

◆ handle_key_press()

void MayaFlux::Portal::Forma::Context::handle_key_press ( IO::Keys  key)
private

Definition at line 478 of file Context.cpp.

479{
480 sync_size();
481 if (!m_focused)
482 return;
483
484 auto it = m_callbacks.find(*m_focused);
485 if (it == m_callbacks.end())
486 return;
487
488 const int key_code = static_cast<int>(key);
489 auto key_it = it->second.key_press.find(key_code);
490 if (key_it != it->second.key_press.end())
491 key_it->second(*m_focused);
492}
void sync_size()
Run the resize callbacks if the window's size differs from the size they last saw.
Definition Context.cpp:537
std::unordered_map< uint32_t, ElementCallbacks > m_callbacks
Definition Context.hpp:361
std::optional< uint32_t > m_focused
Definition Context.hpp:383

References m_callbacks, m_focused, and sync_size().

Referenced by on_press().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: