#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() noexcept = default; void listen() const noexcept override; void attach(const char &event, Callback callback) noexcept override; void notify(const char &event) const noexcept override; void enter_raw_mode() noexcept override; void leave_raw_mode() noexcept override; private: std::unordered_map> _key_observers; std::shared_ptr _original_termios = nullptr; };