OcBootManagementLib: Improve input with PollAppleHotKeys=true
@@ -1098,6 +1098,7 @@ OcWaitForAppleKeyIndex (
//
// Check exact match on index strokes.
//
+ if (Modifiers == 0 && NumKeys == 1) {
OC_STATIC_ASSERT (AppleHidUsbKbUsageKeyOne + 8 == AppleHidUsbKbUsageKeyNine, "Unexpected encoding");
for (KeyCode = AppleHidUsbKbUsageKeyOne; KeyCode <= AppleHidUsbKbUsageKeyNine; ++KeyCode) {
if (OcKeyMapHasKey (Keys, NumKeys, KeyCode)) {
@@ -1111,6 +1112,13 @@ OcWaitForAppleKeyIndex (
return (INTN) (KeyCode - AppleHidUsbKbUsageKeyA + 9);
}
}
+ }
+ //
+ // Abort the timeout when unrecognised keys are pressed.
+ //
+ if (Timeout != 0 && NumKeys != 0) {
+ return OC_INPUT_INVALID;
+ }
MicroSecondDelay (10);
}
