OcBootManagementLib: Fix key polling issue with PollAppleHotKeys=true

This commit is contained in:
Download-Fritz 2019-11-03 21:34:36 +01:00
parent 7b60d73018
commit 120c806604

View File

@ -977,23 +977,23 @@ OcWaitForAppleKeyIndex (
return OC_INPUT_INVALID;
}
NumKeys = ARRAY_SIZE (Keys);
Status = KeyMap->GetKeyStrokes (
KeyMap,
&Modifiers,
&NumKeys,
Keys
);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "OCB: GetKeyStrokes - %r\n", Status));
return OC_INPUT_INVALID;
}
CurrTime = GetTimeInNanoSecond (GetPerformanceCounter ());
EndTime = CurrTime + Timeout * 1000000000ULL;
while (Timeout == 0 || CurrTime == 0 || CurrTime < EndTime) {
NumKeys = ARRAY_SIZE (Keys);
Status = KeyMap->GetKeyStrokes (
KeyMap,
&Modifiers,
&NumKeys,
Keys
);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "OCB: GetKeyStrokes - %r\n", Status));
return OC_INPUT_INVALID;
}
CurrTime = GetTimeInNanoSecond (GetPerformanceCounter ());
HasCommand = (Modifiers & (APPLE_MODIFIER_LEFT_COMMAND | APPLE_MODIFIER_RIGHT_COMMAND)) != 0;