]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Nt32Pkg/WinNtGopDxe/WinNtGop.h
Fix NT32 Keyboard driver to call hotkey callback even no one is calling ReadKeyStroke().
[mirror_edk2.git] / Nt32Pkg / WinNtGopDxe / WinNtGop.h
index c65819aa45550e7d1c39601f032705b5434f0b82..3490de06ca6c7d21843a14a0ff2289e37edfd3df 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -57,14 +57,15 @@ Abstract:
 #define GOP_EXTENDED_KEY         (0x1 << 24)\r
 #define GOP_ALT_KEY_PRESSED      (0x1 << 29)\r
 \r
+#define KEYBOARD_TIMER_INTERVAL         200000  // 0.02s\r
 \r
 #define MAX_Q 256\r
 \r
 typedef struct {\r
-  UINTN         Front;\r
-  UINTN         Rear;\r
-  UINTN         Count;\r
-  EFI_INPUT_KEY Q[MAX_Q];\r
+  UINTN             Front;\r
+  UINTN             Rear;\r
+  EFI_KEY_DATA      Q[MAX_Q];\r
+  CRITICAL_SECTION  Cs;\r
 } GOP_QUEUE_FIXED;\r
 \r
 #define WIN_NT_GOP_CLASS_NAME       L"WinNtGopWindow"\r
@@ -131,11 +132,12 @@ typedef struct {
   EFI_GRAPHICS_OUTPUT_BLT_PIXEL *FillLine;\r
 \r
   //\r
-  // Keyboard Queue used by Simple Text In. WinProc thread adds, and main\r
-  // thread removes.\r
+  // Keyboard Queue used by Simple Text In. \r
+  // QueueForRead:   WinProc thread adds, and main thread removes.\r
+  // QueueForNotify: WinProc thread adds, and timer thread removes.\r
   //\r
-  CRITICAL_SECTION              QCriticalSection;\r
-  GOP_QUEUE_FIXED               Queue;\r
+  GOP_QUEUE_FIXED               QueueForRead;\r
+  GOP_QUEUE_FIXED               QueueForNotify;\r
 \r
   EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL SimpleTextInEx;\r
   EFI_KEY_STATE                     KeyState;\r
@@ -152,7 +154,8 @@ typedef struct {
   BOOLEAN                           SysReq;  \r
   BOOLEAN                           NumLock;\r
   BOOLEAN                           ScrollLock;\r
-  BOOLEAN                           CapsLock;  \r
+  BOOLEAN                           CapsLock;\r
+  EFI_EVENT                         TimerEvent;\r
 } GOP_PRIVATE_DATA;\r
 \r
 #define GOP_PRIVATE_DATA_FROM_THIS(a)  \\r
@@ -308,7 +311,7 @@ WinNtGopDriverBindingStop (
 \r
 **/\r
 EFI_STATUS\r
-GopPrivateAddQ (\r
+GopPrivateAddKey (\r
   IN  GOP_PRIVATE_DATA    *Private,\r
   IN  EFI_INPUT_KEY       Key\r
   );\r