diff options
Diffstat (limited to 'src/engine/user/input.hpp')
-rw-r--r-- | src/engine/user/input.hpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/engine/user/input.hpp b/src/engine/user/input.hpp index 9f565c1..12c27ee 100644 --- a/src/engine/user/input.hpp +++ b/src/engine/user/input.hpp @@ -6,6 +6,7 @@ #include <memory> #include <mutex> +#include <string> class UserInputObserver : public IUserInputObserver, @@ -16,13 +17,13 @@ public: void listen() noexcept override; - auto is_key_pressed(Key key) noexcept -> bool override; + auto get_currently_pressed_key() noexcept -> Key override; - [[nodiscard]] auto get_currently_pressed_key() const noexcept -> Key override; +private: + std::string _input_buffer; + mutable std::mutex _input_buffer_mutex; - void clear_currently_pressed() noexcept override; + auto _get_input_buffer() const noexcept -> std::string; -private: - Key _currently_pressed{}; - std::mutex _currently_pressed_mutex; + void _set_input_buffer(const std::string &input_buffer) noexcept; }; |