diff options
author | Alex AUVOLAT <alexis211@gmail.com> | 2012-05-18 19:06:35 +0200 |
---|---|---|
committer | Alex AUVOLAT <alexis211@gmail.com> | 2012-05-18 19:06:35 +0200 |
commit | 478c691187fbc9ba4ccaacf92f57828eef20041c (patch) | |
tree | 4cb4b00d7da1fd533cebc347f3641cc0455935f5 /src/kernel/ui/vt.cpp | |
parent | 7e6454020ed1143e05e83a683606f318995458e5 (diff) | |
download | TCE-478c691187fbc9ba4ccaacf92f57828eef20041c.tar.gz TCE-478c691187fbc9ba4ccaacf92f57828eef20041c.zip |
Simple shell added. Simple fprintf function added too.
Diffstat (limited to 'src/kernel/ui/vt.cpp')
-rw-r--r-- | src/kernel/ui/vt.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/kernel/ui/vt.cpp b/src/kernel/ui/vt.cpp index 2869fec..2bd82ca 100644 --- a/src/kernel/ui/vt.cpp +++ b/src/kernel/ui/vt.cpp @@ -1,7 +1,7 @@ #include "vt.h" #include <dev/display.h> -vt *ke_vt = 0; +vt *ke_vt = 0, *home_vt = 0; vt::vt(node* parent, int ww, int hh) : node(parent, FT_TERMINAL) { w = ww; h = hh; @@ -9,6 +9,7 @@ vt::vt(node* parent, int ww, int hh) : node(parent, FT_TERMINAL) { bgcolor = TC_BLACK; output = 0; cursor_visible = true; + csr_l = csr_c = 0; kbd_buffer_filled = 0; kbd_waiter = 0; @@ -148,9 +149,18 @@ void vt::outputTo(display *display) { } } } + output->text_setcsr(csr_l, csr_c, cursor_visible); } -void vt::keyboardInput(keypress kp) { +void vt::keyboardInput(keypress kp, keyboard* from) { + if (kp.command == KB_RSUPER || kp.command == KB_LSUPER) { + if (this == home_vt) return; + // go to home terminal + home_vt->outputTo(output); + from->outputTo(home_vt); + output = 0; + return; + } // convert to sequence of chars int n = 0; char b[8]; |