Toast Engine
Loading...
Searching...
No Matches
ui_input.hpp
Go to the documentation of this file.
1
8
9#pragma once
10#include <toast/events/listener.hpp>
11#include <unordered_set>
12
13namespace ui {
14
15class UIInputRouter {
16public:
17 UIInputRouter();
18
19 [[nodiscard]]
20 auto dpRatio() const -> float {
21 return m_dp_ratio;
22 }
23
24private:
25 event::Listener m_listener;
26
28 std::unordered_set<int> m_ui_buttons;
29 std::unordered_set<int> m_ui_keys;
30
31 float m_dp_ratio = 1.0f;
32 int m_mods = 0;
33};
34
35}
manages the lifetime, subscription, and unsubscription of callbacks
Definition listener.hpp:39