diff options
Diffstat (limited to 'src/engine/user/input.cpp')
-rw-r--r-- | src/engine/user/input.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/engine/user/input.cpp b/src/engine/user/input.cpp index 5e6f517..81fe2f6 100644 --- a/src/engine/user/input.cpp +++ b/src/engine/user/input.cpp @@ -1,12 +1,13 @@ #include "input.hpp" +#include <iostream> #include <unistd.h> void InputHandler::listen() const noexcept { char character = 0; - while (read(STDIN_FILENO, &character, 1) == 1) + while (!std::cin.read(&character, 1).fail()) { notify_subscribers(character, nullptr); } |