summaryrefslogtreecommitdiffabout
path: root/TTY.cpp
Side-by-side diff
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