t7.c 648 B

12345678910111213141516171819202122232425
  1. #include <efi.h>
  2. #include <efilib.h>
  3. EFI_STATUS
  4. efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
  5. {
  6. EFI_INPUT_KEY efi_input_key;
  7. EFI_STATUS efi_status;
  8. InitializeLib(image, systab);
  9. Print(L"HelloLib application started\n");
  10. Print(L"\n\n\nHit any key to exit this image\n");
  11. WaitForSingleEvent(ST->ConIn->WaitForKey, 0);
  12. uefi_call_wrapper(ST->ConOut->OutputString, 2, ST->ConOut, L"\n\n");
  13. efi_status = uefi_call_wrapper(ST->ConIn->ReadKeyStroke, 2, ST->ConIn, &efi_input_key);
  14. Print(L"ScanCode: %xh UnicodeChar: %xh CallRtStatus: %x\n",
  15. efi_input_key.ScanCode, efi_input_key.UnicodeChar, efi_status);
  16. return EFI_SUCCESS;
  17. }