]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Nt32Pkg/WinNtGopDxe/WinNtGopInput.c
ArmVirtPkg/PlatformHasAcpiDtDxe: depend on gEfiVariableArchProtocolGuid
[mirror_edk2.git] / Nt32Pkg / WinNtGopDxe / WinNtGopInput.c
index cc05a5d1b8d52a51ec19c909ee6a37edbdca78c3..6a0f4b7892a1a1b7ac42ae007a08ef598b76f9ee 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, 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
@@ -362,16 +362,6 @@ GopPrivateAddKey (
 \r
   GopPrivateAddQ (Private, &Private->QueueForNotify, &KeyData);\r
 \r
-  //\r
-  // Convert Ctrl+[A-Z] to Ctrl+[1-26]\r
-  //\r
-  if (Private->LeftCtrl || Private->RightCtrl) {\r
-    if ((KeyData.Key.UnicodeChar >= L'a') && (KeyData.Key.UnicodeChar <= L'z')) {\r
-      KeyData.Key.UnicodeChar = (CHAR16)(KeyData.Key.UnicodeChar - L'a' + 1);\r
-    } else if ((KeyData.Key.UnicodeChar >= L'A') && (KeyData.Key.UnicodeChar <= L'Z')) {\r
-      KeyData.Key.UnicodeChar = (CHAR16)(KeyData.Key.UnicodeChar - L'A' + 1);\r
-    }\r
-  }\r
   GopPrivateAddQ (Private, &Private->QueueForRead, &KeyData);\r
 \r
   return EFI_SUCCESS;\r
@@ -605,6 +595,16 @@ WinNtGopSimpleTextInReadKeyStroke (
     if (KeyData.Key.ScanCode == SCAN_NULL && KeyData.Key.UnicodeChar == CHAR_NULL) {\r
       continue;\r
     }\r
+    //\r
+    // Convert Ctrl+[A-Z] to Ctrl+[1-26]\r
+    //\r
+    if ((KeyData.KeyState.KeyShiftState & (EFI_LEFT_CONTROL_PRESSED | EFI_RIGHT_CONTROL_PRESSED)) != 0) {\r
+      if ((KeyData.Key.UnicodeChar >= L'a') && (KeyData.Key.UnicodeChar <= L'z')) {\r
+        KeyData.Key.UnicodeChar = (CHAR16) (KeyData.Key.UnicodeChar - L'a' + 1);\r
+      } else if ((KeyData.Key.UnicodeChar >= L'A') && (KeyData.Key.UnicodeChar <= L'Z')) {\r
+        KeyData.Key.UnicodeChar = (CHAR16) (KeyData.Key.UnicodeChar - L'A' + 1);\r
+      }\r
+    }\r
     CopyMem (Key, &KeyData.Key, sizeof (EFI_INPUT_KEY));\r
     return EFI_SUCCESS;\r
   }  \r
@@ -822,7 +822,7 @@ WinNtGopSimpleTextInExRegisterKeyNotify (
   IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL  *This,\r
   IN EFI_KEY_DATA                       *KeyData,\r
   IN EFI_KEY_NOTIFY_FUNCTION            KeyNotificationFunction,\r
-  OUT EFI_HANDLE                        *NotifyHandle\r
+  OUT VOID                              **NotifyHandle\r
   )\r
 /*++\r
 \r
@@ -867,7 +867,7 @@ WinNtGopSimpleTextInExRegisterKeyNotify (
                       );\r
     if (GopPrivateIsKeyRegistered (&CurrentNotify->KeyData, KeyData)) {\r
       if (CurrentNotify->KeyNotificationFn == KeyNotificationFunction) {\r
-        *NotifyHandle = CurrentNotify->NotifyHandle;\r
+        *NotifyHandle = CurrentNotify;\r
         return EFI_SUCCESS;\r
       }\r
     }\r
@@ -883,11 +883,10 @@ WinNtGopSimpleTextInExRegisterKeyNotify (
 \r
   NewNotify->Signature         = WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY_SIGNATURE;\r
   NewNotify->KeyNotificationFn = KeyNotificationFunction;\r
-  NewNotify->NotifyHandle      = (EFI_HANDLE) NewNotify;\r
   CopyMem (&NewNotify->KeyData, KeyData, sizeof (EFI_KEY_DATA));\r
   InsertTailList (&Private->NotifyList, &NewNotify->NotifyEntry);\r
 \r
-  *NotifyHandle = NewNotify->NotifyHandle;\r
+  *NotifyHandle = NewNotify;\r
 \r
   return EFI_SUCCESS;\r
 \r
@@ -897,7 +896,7 @@ EFI_STATUS
 EFIAPI\r
 WinNtGopSimpleTextInExUnregisterKeyNotify (\r
   IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL  *This,\r
-  IN EFI_HANDLE                         NotificationHandle\r
+  IN VOID                               *NotificationHandle\r
   )\r
 /*++\r
 \r
@@ -922,10 +921,6 @@ WinNtGopSimpleTextInExUnregisterKeyNotify (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  if (((WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY *) NotificationHandle)->Signature != WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY_SIGNATURE) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
   Private = GOP_PRIVATE_DATA_FROM_TEXT_IN_EX_THIS (This);\r
 \r
   for (Link = Private->NotifyList.ForwardLink; Link != &Private->NotifyList; Link = Link->ForwardLink) {\r
@@ -935,7 +930,7 @@ WinNtGopSimpleTextInExUnregisterKeyNotify (
                       NotifyEntry,\r
                       WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY_SIGNATURE\r
                       );\r
-    if (CurrentNotify->NotifyHandle == NotificationHandle) {\r
+    if (CurrentNotify == NotificationHandle) {\r
       //\r
       // Remove the notification function from NotifyList and free resources\r
       //\r