summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2018-02-13 17:29:55 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2018-02-15 14:12:51 +0800
commit7cb03133594d67d7f5cc8d13827356e6ce5cf259 (patch)
tree8b6a3f73fa6c7018f245f735081aba92d6afc7a0 /ShellPkg/Library/UefiShellDebug1CommandsLib/Edit
parent5eecb45af0caa07bacc03aecc6cec3f74c6fa95f (diff)
downloadedk2-7cb03133594d67d7f5cc8d13827356e6ce5cf259.zip
edk2-7cb03133594d67d7f5cc8d13827356e6ce5cf259.tar.gz
edk2-7cb03133594d67d7f5cc8d13827356e6ce5cf259.tar.bz2
ShellPkg/[hex]edit: Fix CTRL+<Alpha> doesn't work from hyper terminal
After commit 20ddbc133f679b7895dfdaf2fd58ec4c8183a1d8 * MdeModulePkg/ConSplitter: ReadKeyStrokeEx always return key state When one physical console supports to report the shift key state, the key data returned from ConSplitter driver at least carries the shift key valid bit. The patch fixes the edit/hexedit to accept Unicode (1) when the no shift key is pressed or reported. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Diffstat (limited to 'ShellPkg/Library/UefiShellDebug1CommandsLib/Edit')
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c
index 4eb998b..6832441 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c
@@ -1387,18 +1387,20 @@ MainCommandDisplayHelp (
continue;
}
- if ((KeyData.KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) == 0) {
+ if (((KeyData.KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) == 0) ||
+ (KeyData.KeyState.KeyShiftState == EFI_SHIFT_STATE_VALID)) {
//
- // For consoles that don't support shift state reporting,
+ // For consoles that don't support/report shift state,
// CTRL+W is translated to L'W' - L'A' + 1.
//
if (KeyData.Key.UnicodeChar == L'W' - L'A' + 1) {
break;
}
- } else if (((KeyData.KeyState.KeyShiftState & (EFI_LEFT_CONTROL_PRESSED | EFI_RIGHT_CONTROL_PRESSED)) != 0) &&
+ } else if (((KeyData.KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) != 0) &&
+ ((KeyData.KeyState.KeyShiftState & (EFI_LEFT_CONTROL_PRESSED | EFI_RIGHT_CONTROL_PRESSED)) != 0) &&
((KeyData.KeyState.KeyShiftState & ~(EFI_SHIFT_STATE_VALID | EFI_LEFT_CONTROL_PRESSED | EFI_RIGHT_CONTROL_PRESSED)) == 0)) {
//
- // For consoles that supports shift state reporting,
+ // For consoles that supports/reports shift state,
// make sure that only CONTROL shift key is pressed.
//
if ((KeyData.Key.UnicodeChar == 'w') || (KeyData.Key.UnicodeChar == 'W')) {