61{
62 static BYTE KeyState[256] = { 0 };
63
64
65
66 static UINT LastVirtualKey = 0;
74
76
78 {
79 DPRINT1(
"No Active Console!\n");
80 return;
81 }
82
83 VirtualScanCode =
HIWORD(
msg->lParam) & 0xFF;
86
89
91 {
92 VirtualKeyCode = LastVirtualKey;
93 UnicodeChar =
msg->wParam;
94 }
95 else
96 {
99
100 VirtualKeyCode =
msg->wParam;
102 VirtualScanCode,
103 KeyState,
104 Chars,
105 2,
106 0,
108 UnicodeChar = (RetChars == 1 ? Chars[0] : 0);
109 }
110
111 Fake = UnicodeChar &&
115 if (NotChar) LastVirtualKey =
msg->wParam;
116
117 DPRINT(
"CONSRV: %s %s %s %s %02x %02x '%lc' %04x\n",
118 Down ? "down" : "up ",
120 "char" : "key ",
121 Fake ? "fake" : "real",
122 NotChar ? "notc" : "char",
123 VirtualScanCode,
124 VirtualKeyCode,
125 (UnicodeChar >=
L' ') ? UnicodeChar :
L'.',
126 ShiftState);
127
128 if (Fake) return;
129
130
131
132
133
134#if 0
136 (VirtualKeyCode ==
VK_UP || VirtualKeyCode ==
VK_DOWN) )
137 {
138 if (!Down) return;
139
140
141 if (VirtualKeyCode ==
VK_UP)
142 {
143
144 if (
Console->ActiveBuffer->CursorPosition.Y !=
Console->ActiveBuffer->ScreenBufferSize.Y - 1)
145 {
146 Console->ActiveBuffer->VirtualY = (
Console->ActiveBuffer->VirtualY +
147 Console->ActiveBuffer->ScreenBufferSize.Y - 1) %
148 Console->ActiveBuffer->ScreenBufferSize.Y;
149 Console->ActiveBuffer->CursorPosition.Y++;
150 }
151 }
152 else
153 {
154
155 if (
Console->ActiveBuffer->CursorPosition.Y != 0)
156 {
157 Console->ActiveBuffer->VirtualY = (
Console->ActiveBuffer->VirtualY + 1) %
158 Console->ActiveBuffer->ScreenBufferSize.Y;
159 Console->ActiveBuffer->CursorPosition.Y--;
160 }
161 }
162
164 return;
165 }
166#endif
167
168
169
177
179}
union _KEY_EVENT_RECORD::@3284 uChar
VOID ConioDrawConsole(PCONSRV_CONSOLE Console)
_Check_return_ BOOL WINAPI GetKeyboardState(_Out_writes_(256) PBYTE lpKeyState)
int WINAPI ToUnicodeEx(_In_ UINT wVirtKey, _In_ UINT wScanCode, _In_reads_bytes_(256) CONST BYTE *lpKeyState, _Out_writes_(cchBuff) LPWSTR pwszBuff, _In_ int cchBuff, _In_ UINT wFlags, _In_opt_ HKL dwhkl)