aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/input.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/input.hpp')
-rw-r--r--src/interfaces/input.hpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/interfaces/input.hpp b/src/interfaces/input.hpp
index f93a8e2..8239e48 100644
--- a/src/interfaces/input.hpp
+++ b/src/interfaces/input.hpp
@@ -7,24 +7,16 @@
#include <memory>
// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions)
-class IInputHandler : public IPublisher<char, std::nullptr_t>
+class IUserInputObserver
{
public:
- using Event = char;
- using Context = std::nullptr_t;
+ using Key = char;
- ~IInputHandler() noexcept override = default;
+ virtual ~IUserInputObserver() noexcept = default;
- virtual void listen() const noexcept = 0;
+ virtual void listen() noexcept = 0;
- void subscribe(
- const Event &event,
- const std::shared_ptr<ISubscriber<Context>> &subscriber) noexcept override = 0;
+ virtual bool is_key_pressed(Key key) noexcept = 0;
- void notify_subscribers(const Event &event, const Context &context)
- const noexcept override = 0;
-
- virtual void enter_raw_mode() noexcept = 0;
-
- virtual void leave_raw_mode() noexcept = 0;
+ virtual void clear_currently_pressed() noexcept = 0;
};