diff options
Diffstat (limited to 'UI.cpp')
-rw-r--r-- | UI.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -66,7 +66,7 @@ UI::UI(Config& config): { } -bool UI::key_available() { +bool stdin_available() { struct pollfd fds{}; fds.fd = 0; // stdin fds.events = POLLIN; @@ -76,10 +76,14 @@ bool UI::key_available() { else if (ret == 1) return true; else - log_cout << "Error" << std::endl; + log_cout << "UI: Poll error" << std::endl; return false; } +bool UI::key_available() { + return stdin_available() || m_touchpad.event_available(); +} + int read_key() { char buf[1]; int got = read(0, buf, 1); |