aboutsummaryrefslogtreecommitdiff
path: root/src/util/term.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/term.cc')
-rw-r--r--src/util/term.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/util/term.cc b/src/util/term.cc
index 9e4c101..704f872 100644
--- a/src/util/term.cc
+++ b/src/util/term.cc
@@ -1,5 +1,7 @@
#include "term.h"
+#include <system_error>
+
#include <termbox.h>
namespace util {
@@ -27,4 +29,14 @@ TermGuard::~TermGuard() {
tb_shutdown();
}
+tb_event TermGuard::poll() const {
+ struct tb_event event;
+
+ if ( tb_poll_event(&event) == -1 ) {
+ throw std::system_error();
+ } else {
+ return event;
+ }
+}
+
}