author | Michael Krelin <hacker@klever.net> | 2004-07-05 01:53:09 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2004-07-05 01:53:09 (UTC) |
commit | 885f8cc426a8840ae61023b75f3f0e4a1e268082 (patch) (unidiff) | |
tree | 5e942d450c97ca0bf0f9cfb80aa0fefb486535d9 /TTY.cpp | |
download | kinsole-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
-rw-r--r-- | TTY.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
@@ -0,0 +1,45 @@ | |||
1 | class CTTY{ | ||
2 | public: | ||
3 | virtual BOOL Input(UINT c) { | ||
4 | VERIFY(SendLiteral(c)); | ||
5 | if( | ||
6 | ( | ||
7 | Options[toEcho].m_StateU==TOption::stateYes | ||
8 | || Options[toEcho].m_StateU==TOption::stateNone | ||
9 | ) && ( | ||
10 | Options[toEcho].m_StateH!=TOption::stateYes | ||
11 | || Options[toEcho].m_StateH==TOption::stateNone | ||
12 | ) | ||
13 | ){ | ||
14 | PreOutput(); | ||
15 | Output(c); | ||
16 | PostOutput(); | ||
17 | } | ||
18 | return TRUE; | ||
19 | } | ||
20 | virtual BOOL VInput(WORD vk,DWORD cks) { | ||
21 | return TRUE; | ||
22 | } | ||
23 | virtualBOOL PreOutput() { | ||
24 | return TRUE; | ||
25 | } | ||
26 | virtual BOOL Output(UINT c) { | ||
27 | if(!c) | ||
28 | return TRUE; | ||
29 | static DWORD dummyWritten = 0; | ||
30 | VERIFY(::WriteConsole(hConsoleOutput,&c,1,&dummyWritten,NULL)); | ||
31 | return TRUE; | ||
32 | } | ||
33 | virtual BOOL PostOutput() { | ||
34 | return TRUE; | ||
35 | } | ||
36 | virtual BOOL Init() { | ||
37 | return TRUE; | ||
38 | } | ||
39 | virtual LPCTSTR GetTitle() { | ||
40 | if(TTTermType<0) | ||
41 | return "Unknown Terminal Type"; | ||
42 | return TTypes[TTTermType].m_Name; | ||
43 | } | ||
44 | } | ||
45 | TT_TTY; \ No newline at end of file | ||