From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D861D22161178 for ; Wed, 14 Feb 2018 06:56:59 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Feb 2018 07:02:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,512,1511856000"; d="scan'208";a="175053399" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga004.jf.intel.com with ESMTP; 14 Feb 2018 07:02:51 -0800 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 14 Feb 2018 07:02:50 -0800 Received: from fmsmsx103.amr.corp.intel.com ([169.254.2.47]) by FMSMSX153.amr.corp.intel.com ([169.254.9.82]) with mapi id 14.03.0319.002; Wed, 14 Feb 2018 07:02:50 -0800 From: "Carsey, Jaben" To: "Ni, Ruiyu" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [PATCH] ShellPkg/[hex]edit: Fix CTRL+ doesn't work from hyper terminal Thread-Index: AQHTpK9JJCDXO2kfFUaAhG2swJ868qOkAGBg Date: Wed, 14 Feb 2018 15:02:50 +0000 Message-ID: References: <20180213094438.119760-1-ruiyu.ni@intel.com> In-Reply-To: <20180213094438.119760-1-ruiyu.ni@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYWJiZDg5MjItNzMzNS00ODkxLTllYzItMjcwODE4YzcwMzcxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IkdRYVFmWGZXaW96Z2N2RkkwY1pyVkp5MlpNclpXZVgxTENCNDNYTDhSeDA9In0= x-ctpclassification: CTP_NT x-originating-ip: [10.1.200.107] MIME-Version: 1.0 Subject: Re: [PATCH] ShellPkg/[hex]edit: Fix CTRL+ doesn't work from hyper terminal X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 14:57:01 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jaben Carsey > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Ruiyu Ni > Sent: Tuesday, February 13, 2018 1:45 AM > To: edk2-devel@lists.01.org > Cc: Carsey, Jaben > Subject: [edk2] [PATCH] ShellPkg/[hex]edit: Fix CTRL+ doesn't work > from hyper terminal > Importance: High >=20 > After commit 20ddbc133f679b7895dfdaf2fd58ec4c8183a1d8 > * MdeModulePkg/ConSplitter: ReadKeyStrokeEx always return key state >=20 > 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. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ruiyu Ni > Cc: Jaben Carsey > --- > .../Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c | 10 > ++++++---- > ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c | 10 > ++++++---- > .../Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c | 10 > ++++++---- > 3 files changed, 18 insertions(+), 12 deletions(-) >=20 > diff --git > a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c > b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c > index 4eb998bf5f..6832441e81 100644 > --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c > +++ > b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c > @@ -1387,18 +1387,20 @@ MainCommandDisplayHelp ( > continue; > } >=20 > - if ((KeyData.KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) =3D=3D = 0) { > + if (((KeyData.KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) =3D=3D= 0) || > + (KeyData.KeyState.KeyShiftState =3D=3D 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 =3D=3D L'W' - L'A' + 1) { > break; > } > - } else if (((KeyData.KeyState.KeyShiftState & > (EFI_LEFT_CONTROL_PRESSED | EFI_RIGHT_CONTROL_PRESSED)) !=3D 0) && > + } else if (((KeyData.KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID)= !=3D > 0) && > + ((KeyData.KeyState.KeyShiftState & (EFI_LEFT_CONTROL_PRES= SED > | EFI_RIGHT_CONTROL_PRESSED)) !=3D 0) && > ((KeyData.KeyState.KeyShiftState & ~(EFI_SHIFT_STATE_VALI= D | > EFI_LEFT_CONTROL_PRESSED | EFI_RIGHT_CONTROL_PRESSED)) =3D=3D 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 =3D=3D 'w') || (KeyData.Key.UnicodeCh= ar =3D=3D > 'W')) { > diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c > b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c > index b86594bb28..58e90ac5b2 100644 > --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c > +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c > @@ -183,16 +183,18 @@ MenuBarDispatchControlHotKey ( > // > ControlIndex =3D MAX_UINT16; >=20 > - if ((KeyData->KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) =3D=3D 0= ) { > + if (((KeyData->KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) =3D=3D = 0) || > + (KeyData->KeyState.KeyShiftState =3D=3D EFI_SHIFT_STATE_VALID)) { > // > - // For those console devices that cannot report the CONTROL state, > + // For consoles that don't support/report shift state, > // Ctrl+A is translated to 1 (UnicodeChar). > // > ControlIndex =3D KeyData->Key.UnicodeChar; > - } else if (((KeyData->KeyState.KeyShiftState & > (EFI_RIGHT_CONTROL_PRESSED | EFI_LEFT_CONTROL_PRESSED)) !=3D 0) && > + } else if (((KeyData->KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) = !=3D > 0) && > + ((KeyData->KeyState.KeyShiftState & > (EFI_RIGHT_CONTROL_PRESSED | EFI_LEFT_CONTROL_PRESSED)) !=3D 0) && > ((KeyData->KeyState.KeyShiftState & ~(EFI_SHIFT_STATE_VALID= | > EFI_RIGHT_CONTROL_PRESSED | EFI_LEFT_CONTROL_PRESSED)) =3D=3D 0)) { > // > - // For those console devices that can report the CONTROL state, > + // For consoles that supports/reports shift state, > // make sure only CONTROL is pressed. > // > if ((KeyData->Key.UnicodeChar >=3D L'A') && (KeyData->Key.UnicodeCha= r > <=3D L'Z')) { > diff --git > a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c > b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c > index 2b096d7168..a2e52ea39c 100644 > --- > a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c > +++ > b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c > @@ -134,18 +134,20 @@ HMainCommandDisplayHelp ( > continue; > } >=20 > - if ((KeyData.KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) =3D=3D = 0) { > + if (((KeyData.KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) =3D=3D= 0) || > + (KeyData.KeyState.KeyShiftState =3D=3D 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 =3D=3D L'W' - L'A' + 1) { > break; > } > - } else if (((KeyData.KeyState.KeyShiftState & > (EFI_LEFT_CONTROL_PRESSED | EFI_RIGHT_CONTROL_PRESSED)) !=3D 0) && > + } else if (((KeyData.KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID)= !=3D > 0) && > + ((KeyData.KeyState.KeyShiftState & (EFI_LEFT_CONTROL_PRES= SED > | EFI_RIGHT_CONTROL_PRESSED)) !=3D 0) && > ((KeyData.KeyState.KeyShiftState & ~(EFI_SHIFT_STATE_VALI= D | > EFI_LEFT_CONTROL_PRESSED | EFI_RIGHT_CONTROL_PRESSED)) =3D=3D 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 =3D=3D 'w') || (KeyData.Key.UnicodeCh= ar =3D=3D > 'W')) { > -- > 2.16.1.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel