diff options
author | Roland Reichwein <mail@reichwein.it> | 2025-01-06 00:38:12 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2025-01-06 00:38:12 +0100 |
commit | 0dd9b216bf98c0504e039f7d71b0cae7493f4f2c (patch) | |
tree | 2f5310264deba5ae260261889eb83a90ec801067 | |
parent | c072b661564e1ce3f0f01f1b6ddba0266fbb47b6 (diff) |
FIx input (2: keyboard and touchpad)
-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); |