Home | History | Annotate | Line # | Download | only in apps
      1 /*	$NetBSD: t7.c,v 1.1.1.2 2018/08/16 18:17:47 jmcneill Exp $	*/
      2 
      3 #include <efi.h>
      4 #include <efilib.h>
      5 
      6 EFI_STATUS
      7 efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
      8 {
      9 	EFI_INPUT_KEY efi_input_key;
     10 	EFI_STATUS efi_status;
     11 
     12 	InitializeLib(image, systab);
     13 
     14 	Print(L"HelloLib application started\n");
     15 
     16 	Print(L"\n\n\nHit any key to exit this image\n");
     17 	WaitForSingleEvent(ST->ConIn->WaitForKey, 0);
     18 
     19 	uefi_call_wrapper(ST->ConOut->OutputString, 2, ST->ConOut, L"\n\n");
     20 
     21 	efi_status = uefi_call_wrapper(ST->ConIn->ReadKeyStroke, 2, ST->ConIn, &efi_input_key);
     22 
     23 	Print(L"ScanCode: %xh  UnicodeChar: %xh CallRtStatus: %x\n",
     24 		efi_input_key.ScanCode, efi_input_key.UnicodeChar, efi_status);
     25 
     26 	return EFI_SUCCESS;
     27 }
     28