#pragma once #include "DI/auto_wirable.hpp" #include "interfaces/input.hpp" #include "interfaces/observable.hpp" #include #include #include #include class InputHandler : public IInputHandler, public AutoWirable { public: InputHandler() = default; void listen() const override; void attach(const char &event, Callback callback) override; void notify(const char &event) const override; void enter_raw_mode() override; void leave_raw_mode() override; private: std::unordered_map> _key_observers; std::shared_ptr _original_termios = nullptr; };