Continue C++ rewrite.

This commit is contained in:
2025-11-25 00:04:58 -08:00
parent bbb23916a0
commit 881e2b3393
13 changed files with 1563 additions and 213 deletions

29
input_handler.h Normal file
View File

@@ -0,0 +1,29 @@
#ifndef INPUT_HANDLER_HPP
#define INPUT_HANDLER_HPP
#include <cstdint>
namespace ke {
/**
* Input handler class for reading and processing keyboard input.
*/
class InputHandler {
public:
InputHandler() = default;
~InputHandler() = default;
// Deleted copy constructor and assignment
InputHandler(const InputHandler&) = delete;
InputHandler& operator=(const InputHandler&) = delete;
// Read a keypress from stdin
static int16_t get_keypress();
// Check if a key code is an arrow/navigation key
static bool is_arrow_key(int16_t c);
};
} // namespace ke
#endif // INPUT_HANDLER_HPP