diff --git a/include/ftxui/component/event_input_listener.hpp b/include/ftxui/component/event_input_listener.hpp deleted file mode 100644 index f90fdd7..0000000 --- a/include/ftxui/component/event_input_listener.hpp +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef FTXUI_COMPONENT_EVENT_INPUT_LISTENER_HPP -#define FTXUI_COMPONENT_EVENT_INPUT_LISTENER_HPP - -#include -#include -#include - -#include "event.hpp" - -#ifdef WIN32 - #include - #include - #include -#endif - -namespace ftxui { - -// Receives input events from the OS and turns them into -// Event objects and sends to a consumer -// -// On NIX systems: -// - uses SIGWINCH for resize -// - uses getchar() for keypresses -// -// On Windows systems: -// - Uses ReadConsoleInput for resize and keypresses -class EventInputListener { - public: - EventInputListener(std::function consumer); - ~EventInputListener(); - - void stop(); - - private: - char readchar(); - void readchar_thread_func(std::function consumer); - - std::atomic quit_{false}; - std::thread readchar_thread_; -#ifndef _WIN32 - using signal_handler_t = void (*)(int); - signal_handler_t old_sigwinch_handler_; -#else - void input_thread_func(std::function consumer); - - std::mutex input_queue_mutex_; - std::condition_variable input_queue_condvar_; - std::deque input_queue_; - std::thread input_event_thread_; -#endif -}; - -} // namespace ftxui - -#endif /* end of include guard: FTXUI_COMPONENT_EVENT_INPUT_LISTENER_HPP */