summaryrefslogtreecommitdiffabout
path: root/TTY.cpp
authorMichael Krelin <hacker@klever.net>2004-07-05 01:53:09 (UTC)
committer Michael Krelin <hacker@klever.net>2004-07-05 01:53:09 (UTC)
commit885f8cc426a8840ae61023b75f3f0e4a1e268082 (patch) (side-by-side diff)
tree5e942d450c97ca0bf0f9cfb80aa0fefb486535d9 /TTY.cpp
downloadkinsole-885f8cc426a8840ae61023b75f3f0e4a1e268082.zip
kinsole-885f8cc426a8840ae61023b75f3f0e4a1e268082.tar.gz
kinsole-885f8cc426a8840ae61023b75f3f0e4a1e268082.tar.bz2
initial commit into svn repository
git-svn-id: http://svn.klever.net/kin/kinsole/trunk@1 fe716a7a-6dde-0310-88d9-d003556173a8
Diffstat (limited to 'TTY.cpp') (more/less context) (show whitespace changes)
-rw-r--r--TTY.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/TTY.cpp b/TTY.cpp
new file mode 100644
index 0000000..6d4cc73
--- a/dev/null
+++ b/TTY.cpp
@@ -0,0 +1,45 @@
+class CTTY {
+public:
+ virtual BOOL Input(UINT c) {
+ VERIFY(SendLiteral(c));
+ if(
+ (
+ Options[toEcho].m_StateU==TOption::stateYes
+ || Options[toEcho].m_StateU==TOption::stateNone
+ ) && (
+ Options[toEcho].m_StateH!=TOption::stateYes
+ || Options[toEcho].m_StateH==TOption::stateNone
+ )
+ ){
+ PreOutput();
+ Output(c);
+ PostOutput();
+ }
+ return TRUE;
+ }
+ virtual BOOL VInput(WORD vk,DWORD cks) {
+ return TRUE;
+ }
+ virtual BOOL PreOutput() {
+ return TRUE;
+ }
+ virtual BOOL Output(UINT c) {
+ if(!c)
+ return TRUE;
+ static DWORD dummyWritten = 0;
+ VERIFY(::WriteConsole(hConsoleOutput,&c,1,&dummyWritten,NULL));
+ return TRUE;
+ }
+ virtual BOOL PostOutput() {
+ return TRUE;
+ }
+ virtual BOOL Init() {
+ return TRUE;
+ }
+ virtual LPCTSTR GetTitle() {
+ if(TTTermType<0)
+ return "Unknown Terminal Type";
+ return TTypes[TTTermType].m_Name;
+ }
+}
+ TT_TTY; \ No newline at end of file