summaryrefslogtreecommitdiffstats
path: root/src/input.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/input.cpp')
-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