| 37 | } |
| 38 | |
| 39 | VOID PauseForKey(CONST CHAR16* msg) |
| 40 | { |
| 41 | UINTN index; |
| 42 | if (msg) { |
| 43 | printf("\n %ls", msg); |
| 44 | } |
| 45 | printf("\n* Hit any key to continue *"); |
| 46 | |
| 47 | if (ReadAllKeyStrokes()) { // remove buffered key strokes |
| 48 | gBS->Stall(5000000); // 5 seconds delay |
| 49 | ReadAllKeyStrokes(); // empty the buffer again |
| 50 | } |
| 51 | |
| 52 | gBS->WaitForEvent(1, &gST->ConIn->WaitForKey, &index); |
| 53 | ReadAllKeyStrokes(); // empty the buffer to protect the menu |
| 54 | |
| 55 | printf("\n"); |
| 56 | } |
| 57 | |
| 58 | // Jief, TODO : not sure of the difference between this and PauseForKey. Looks like none. Can it be removed ? |
| 59 | |