continue;\r
}\r
\r
- if ((KeyData.KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) == 0) {\r
+ if (((KeyData.KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) == 0) ||\r
+ (KeyData.KeyState.KeyShiftState == EFI_SHIFT_STATE_VALID)) {\r
//\r
- // For consoles that don't support shift state reporting,\r
+ // For consoles that don't support/report shift state,\r
// CTRL+W is translated to L'W' - L'A' + 1.\r
//\r
if (KeyData.Key.UnicodeChar == L'W' - L'A' + 1) {\r
break;\r
}\r
- } else if (((KeyData.KeyState.KeyShiftState & (EFI_LEFT_CONTROL_PRESSED | EFI_RIGHT_CONTROL_PRESSED)) != 0) &&\r
+ } else if (((KeyData.KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) != 0) &&\r
+ ((KeyData.KeyState.KeyShiftState & (EFI_LEFT_CONTROL_PRESSED | EFI_RIGHT_CONTROL_PRESSED)) != 0) &&\r
((KeyData.KeyState.KeyShiftState & ~(EFI_SHIFT_STATE_VALID | EFI_LEFT_CONTROL_PRESSED | EFI_RIGHT_CONTROL_PRESSED)) == 0)) {\r
//\r
- // For consoles that supports shift state reporting,\r
+ // For consoles that supports/reports shift state,\r
// make sure that only CONTROL shift key is pressed.\r
//\r
if ((KeyData.Key.UnicodeChar == 'w') || (KeyData.Key.UnicodeChar == 'W')) {\r
// Find mouse in System Table ConsoleInHandle\r
//\r
Status = gBS->HandleProtocol (\r
- gST->ConIn,\r
+ gST->ConsoleInHandle,\r
&gEfiSimplePointerProtocolGuid,\r
(VOID**)&MainEditor.MouseInterface\r
);\r
EFI_KEY_DATA KeyData;\r
EFI_STATUS Status;\r
EFI_SIMPLE_POINTER_STATE MouseState;\r
- UINTN EventIndex;\r
BOOLEAN NoShiftState;\r
\r
do {\r
}\r
}\r
\r
- Status = gBS->WaitForEvent (1, &MainEditor.TextInputEx->WaitForKeyEx, &EventIndex);\r
- if (!EFI_ERROR (Status) && EventIndex == 0) {\r
+ //\r
+ // CheckEvent() returns Success when non-partial key is pressed.\r
+ //\r
+ Status = gBS->CheckEvent (MainEditor.TextInputEx->WaitForKeyEx);\r
+ if (!EFI_ERROR (Status)) {\r
Status = MainEditor.TextInputEx->ReadKeyStrokeEx (MainEditor.TextInputEx, &KeyData);\r
if (!EFI_ERROR (Status)) {\r
//\r
}\r
\r
}\r
- //\r
- // after handling, refresh editor\r
- //\r
- MainEditorRefresh ();\r
}\r
+ //\r
+ // after handling, refresh editor\r
+ //\r
+ MainEditorRefresh ();\r
\r
} while (Status != EFI_OUT_OF_RESOURCES && !EditorExit);\r
\r