diff options
author | Joursoir <chat@joursoir.net> | 2021-12-01 19:39:14 +0300 |
---|---|---|
committer | Joursoir <chat@joursoir.net> | 2021-12-01 19:39:14 +0300 |
commit | 5b90554b7604b76c1ba912cb585e30876d6042ba (patch) | |
tree | 60afde575e61b20aa8a44c4b39f5767fe065233f /Library/UefiShellUfmCommandLib/tbi/win.c | |
parent | c106872dd21b8b229941a942f6a5e2d4a5b7b575 (diff) | |
download | ufm-5b90554b7604b76c1ba912cb585e30876d6042ba.tar.gz ufm-5b90554b7604b76c1ba912cb585e30876d6042ba.tar.bz2 ufm-5b90554b7604b76c1ba912cb585e30876d6042ba.zip |
tbi/win: make wgetch()
Diffstat (limited to 'Library/UefiShellUfmCommandLib/tbi/win.c')
-rw-r--r-- | Library/UefiShellUfmCommandLib/tbi/win.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Library/UefiShellUfmCommandLib/tbi/win.c b/Library/UefiShellUfmCommandLib/tbi/win.c index 55171da..6ef09a2 100644 --- a/Library/UefiShellUfmCommandLib/tbi/win.c +++ b/Library/UefiShellUfmCommandLib/tbi/win.c @@ -5,6 +5,7 @@ #include <Library/PrintLib.h> // UnicodeVSPrint() #include <Library/BaseMemoryLib.h> #include <Library/MemoryAllocationLib.h> +#include <Library/UefiBootServicesTableLib.h> #include "screen.h" #include "win.h" @@ -122,6 +123,24 @@ VOID echo(struct window *w, BOOLEAN state) w->echo = state; } +EFI_INPUT_KEY wgetch(struct window *w) +{ + UINTN key_event = 0; + EFI_SIMPLE_TEXT_INPUT_PROTOCOL *stdin; + EFI_INPUT_KEY key = { 0 }; + + ASSERT(w != NULL); + + stdin = w->scr->stdin; + gBS->WaitForEvent(1, &stdin->WaitForKey, &key_event); + stdin->ReadKeyStroke(stdin, &key); + + if(echo) { + ; // print char + } + return key; +} + BOOLEAN wmove(struct window *w, INT32 x, INT32 y) { ASSERT(w != NULL); |