mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 22:53:34 +00:00
adding multiple hooks supports for events and loop
This commit is contained in:
@@ -12,9 +12,13 @@ namespace mlx
|
||||
{
|
||||
if(!m_windows.contains(window_id))
|
||||
return;
|
||||
if(!m_events_hooks.contains(window_id) || !m_events_hooks[window_id][event].hook)
|
||||
if(!m_events_hooks.contains(window_id) || m_events_hooks[window_id][event].empty())
|
||||
return;
|
||||
m_events_hooks[window_id][event].hook(code, m_events_hooks[window_id][event].param);
|
||||
for(const auto& hook : m_events_hooks[window_id][event])
|
||||
{
|
||||
if(hook.fn)
|
||||
hook.fn(code, hook.param);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user