Pal/Console.Uefi.cs
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
namespace System
{
public static class Console
{
public static unsafe string Title
{
set
{
}
}
public static unsafe bool CursorVisible
{
set
{
EfiRuntimeHost.SystemTable->ConOut->EnableCursor(EfiRuntimeHost.SystemTable->ConOut, value);
}
}
public unsafe static ConsoleColor ForegroundColor
{
set
{
uint color = (ushort)value;
EfiRuntimeHost.SystemTable->ConOut->SetAttribute(EfiRuntimeHost.SystemTable->ConOut, color);
}
}
static char lastKey = '\0';
static ushort lastScanCode;
public static unsafe bool KeyAvailable
{
get
{
EFI_INPUT_KEY key;
var errorCode = EfiRuntimeHost.SystemTable->ConIn->ReadKeyStroke(EfiRuntimeHost.SystemTable->ConIn, &key);
lastKey = (char)key.UnicodeChar;
lastScanCode = key.ScanCode;
return errorCode == 0;
}
}
public static unsafe void Clear()
{
EfiRuntimeHost.SystemTable->ConOut->ClearScreen(EfiRuntimeHost.SystemTable->ConOut);
}
public static unsafe ConsoleKeyInfo ReadKey(bool intercept)
{
char c = lastKey;
ConsoleKey k = default;
if (lastScanCode != 0)
{
k = lastScanCode switch
{
1 => ConsoleKey.UpArrow,
2 => ConsoleKey.DownArrow,
3 => ConsoleKey.RightArrow,
4 => ConsoleKey.LeftArrow,
后面还有 38 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
