summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2018-03-06 16:20:44 +0800
committerJeremy Kerr <jk@ozlabs.org>2018-04-12 14:22:33 +0800
commitc13dc815beecd283508c80ab0e426f12f2b14955 (patch)
tree21d565f92fb00f34f5a33c5e69bbadc721ed20e6
parent0f22891be18848ef14d8561ef89d2da3d21341d5 (diff)
downloadfbterm-c13dc815beecd283508c80ab0e426f12f2b14955.tar.gz
fbterm-c13dc815beecd283508c80ab0e426f12f2b14955.zip
input: Add null input implementation
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
-rw-r--r--src/input.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/input.cpp b/src/input.cpp
index bab9b08..5403ce0 100644
--- a/src/input.cpp
+++ b/src/input.cpp
@@ -60,9 +60,22 @@ private:
bool inited = false;
};
+class TtyInputNull : public TtyInput {
+ friend class TtyInput;
+
+public:
+ void switchVc(bool enter);
+ void setRawMode(bool raw, bool force = false);
+ void showInfo(bool verbose);
+
+protected:
+ TtyInputNull();
+};
+
TtyInput *TtyInput::createInstance()
{
s8 buf[64];
+
if (ttyname_r(STDIN_FILENO, buf, sizeof(buf))) {
fprintf(stderr, "stdin isn't a tty!\n");
return 0;
@@ -329,3 +342,19 @@ void TtyInputVT::processRawKeys(s8 *buf, u32 len)
if (shell && len > start) shell->keyInput(buf + start, len - start);
}
+
+void TtyInputNull::switchVc(bool enter)
+{
+}
+
+void TtyInputNull::setRawMode(bool raw, bool force)
+{
+}
+
+void TtyInputNull::showInfo(bool verbose)
+{
+}
+
+TtyInputNull::TtyInputNull()
+{
+}
OpenPOWER on IntegriCloud