}\r
\r
//\r
- // Invoke notification functions if exist\r
+ // Signal KeyNotify process event if this key pressed matches any key registered.\r
//\r
for (Link = GetFirstNode (&ConsoleIn->NotifyList); !IsNull (&ConsoleIn->NotifyList, Link); Link = GetNextNode (&ConsoleIn->NotifyList, Link)) {\r
CurrentNotify = CR (\r
KEYBOARD_CONSOLE_IN_EX_NOTIFY_SIGNATURE\r
);\r
if (IsKeyRegistered (&CurrentNotify->KeyData, &KeyData)) {\r
- CurrentNotify->KeyNotificationFn (&KeyData);\r
+ //\r
+ // The key notification function needs to run at TPL_CALLBACK\r
+ // while current TPL is TPL_NOTIFY. It will be invoked in\r
+ // KeyNotifyProcessHandler() which runs at TPL_CALLBACK.\r
+ //\r
+ PushEfikeyBufTail (&ConsoleIn->EfiKeyQueueForNotify, &KeyData);\r
+ gBS->SignalEvent (ConsoleIn->KeyNotifyProcessEvent);\r
}\r
}\r
\r
ConsoleIn->ScancodeQueue.Tail = 0;\r
ConsoleIn->EfiKeyQueue.Head = 0;\r
ConsoleIn->EfiKeyQueue.Tail = 0;\r
+ ConsoleIn->EfiKeyQueueForNotify.Head = 0;\r
+ ConsoleIn->EfiKeyQueueForNotify.Tail = 0;\r
\r
//\r
// Reset the status indicators\r