X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=boot%2Ffreeldr%2Ffreeldr%2Fui%2Fdirectui.c;h=a602700988c106b174a16103cc7bca9c1c5371d2;hp=352f8309fc507571babb862dcdd5df6cb7720d94;hb=f8d3f9de29982a27a125a2338aaf5ea722211a66;hpb=a94d24fe201bd5eb8e9bf0230e2e03df0ee419c5 diff --git a/boot/freeldr/freeldr/ui/directui.c b/boot/freeldr/freeldr/ui/directui.c index 352f8309fc5..a602700988c 100644 --- a/boot/freeldr/freeldr/ui/directui.c +++ b/boot/freeldr/freeldr/ui/directui.c @@ -556,6 +556,31 @@ UiDisplayMenu(IN PCSTR MenuHeader, ULONG CurrentClockSecond; ULONG KeyPress; + /* + * Before taking any default action if there is no timeout, + * check whether the supplied key filter callback function + * may handle a specific user keypress. If it does, the + * timeout is cancelled. + */ + if (!MenuTimeOut && KeyPressFilter && MachConsKbHit()) + { + /* Get the key */ + KeyPress = MachConsGetCh(); + + /* Is it extended? Then get the extended key */ + if (!KeyPress) KeyPress = MachConsGetCh(); + + /* + * Call the supplied key filter callback function to see + * if it is going to handle this keypress. + */ + if (KeyPressFilter(KeyPress)) + { + /* It processed the key character, cancel the timeout */ + MenuTimeOut = -1; + } + } + /* Check if there's no timeout */ if (!MenuTimeOut) {