Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ KeyAvailable

bool System.ConsolePal.KeyAvailable
staticget

Definition at line 182 of file ConsolePal.cs.

183 {
184 get
185 {
186 if (_cachedInputRecord.eventType == 1)
187 {
188 return true;
189 }
190 global::Interop.InputRecord buffer = default(global::Interop.InputRecord);
191 int numEventsRead = 0;
192 while (true)
193 {
194 if (!global::Interop.Kernel32.PeekConsoleInput(InputHandle, out buffer, 1, out numEventsRead))
195 {
196 int lastPInvokeError = Marshal.GetLastPInvokeError();
197 if (lastPInvokeError == 6)
198 {
200 }
201 throw System.IO.Win32Marshal.GetExceptionForWin32Error(lastPInvokeError, "stdin");
202 }
203 if (numEventsRead == 0)
204 {
205 return false;
206 }
208 {
209 break;
210 }
211 if (!global::Interop.Kernel32.ReadConsoleInput(InputHandle, out buffer, 1, out numEventsRead))
212 {
214 }
215 }
216 return true;
217 }
218 }
static bool IsModKey(global::Interop.InputRecord ir)
static IntPtr InputHandle
static bool IsKeyDownEvent(global::Interop.InputRecord ir)
static global::Interop.InputRecord _cachedInputRecord
static Exception GetExceptionForWin32Error(int errorCode, string path="")
static string InvalidOperation_ConsoleKeyAvailableOnFile
Definition SR.cs:68
Definition SR.cs:7