From c878c061227017e98014f847a0b413026b596999 Mon Sep 17 00:00:00 2001 From: Joursoir Date: Sun, 24 Apr 2022 19:30:43 +0300 Subject: main: add a keyboard context to a graphics context --- UefiMonitorTest/UefiMonitorTest.c | 11 +++++++++++ UefiMonitorTest/UefiMonitorTest.h | 4 ++++ UefiMonitorTest/UefiMonitorTest.inf | 1 + 3 files changed, 16 insertions(+) diff --git a/UefiMonitorTest/UefiMonitorTest.c b/UefiMonitorTest/UefiMonitorTest.c index 92e5799..679eed9 100644 --- a/UefiMonitorTest/UefiMonitorTest.c +++ b/UefiMonitorTest/UefiMonitorTest.c @@ -193,6 +193,17 @@ PrepareGraphicsInfo ( Graphics->PixelWidth = PixelWidth; Graphics->Pitch = Gop->Mode->Info->PixelsPerScanLine; + // Find TextInEx in System Table ConsoleInHandle + Status = gBS->HandleProtocol ( + gST->ConsoleInHandle, + &gEfiSimpleTextInputExProtocolGuid, + (VOID **)&Graphics->TextInputEx + ); + if (EFI_ERROR (Status)) { + FreePool (Graphics->BackBuffer); + return Status; + } + // Find mouse in System Table ConsoleInHandle Status = gBS->HandleProtocol ( gST->ConsoleInHandle, diff --git a/UefiMonitorTest/UefiMonitorTest.h b/UefiMonitorTest/UefiMonitorTest.h index 3f82246..7b07c31 100644 --- a/UefiMonitorTest/UefiMonitorTest.h +++ b/UefiMonitorTest/UefiMonitorTest.h @@ -57,6 +57,10 @@ typedef struct { /// UINT32 Pitch; // + // The EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance. + // + EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *TextInputEx; + // // A mouse support. // BOOLEAN MouseSupported; diff --git a/UefiMonitorTest/UefiMonitorTest.inf b/UefiMonitorTest/UefiMonitorTest.inf index 7eb27cc..e0e7c13 100644 --- a/UefiMonitorTest/UefiMonitorTest.inf +++ b/UefiMonitorTest/UefiMonitorTest.inf @@ -26,6 +26,7 @@ [Protocols] gEfiSimplePointerProtocolGuid + gEfiSimpleTextInputExProtocolGuid [FeaturePcd] -- cgit v1.2.3-18-g5258