From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-40131.protonmail.ch (mail-40131.protonmail.ch [185.70.40.131]) by mx.groups.io with SMTP id smtpd.web12.6473.1587574572994381868 for ; Wed, 22 Apr 2020 09:56:13 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@protonmail.com header.s=protonmail header.b=GDxC8JHO; spf=pass (domain: protonmail.com, ip: 185.70.40.131, mailfrom: vit9696@protonmail.com) Date: Wed, 22 Apr 2020 16:55:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1587574568; bh=6Ii3q5MESRm0xF+gz7SsEt1/KRYfpvRExIjrsDFziYI=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=GDxC8JHO/gG41ecq6dMJhM5tzAL6Jkam8Y+T8Y+SPOcaS1rG9iHlHUUy8kk4vGLUe KXF/ieitAeK3OnXALmNHIc0V82h8O3q00Ys7i+D7QEvfF0a6YtYmpu8MLxrwPJCG6Q OV2aFcm0LGsgH6EkvM31r15nY3xuqYZmYaNfF55Y= To: "Gao, Zhichao" , "Rothman, Michael A" From: "Vitaly Cheptsov" Cc: "devel@edk2.groups.io" , Andrew Fish , Laszlo Ersek , =?UTF-8?Q?Marvin_H=C3=A4user?= , "Kinney, Michael D" , "Ni, Ray" Reply-To: vit9696 Subject: Re: [edk2-devel] [PATCH 1/1] ShellPkg: Add support for input with separately reported modifiers Message-ID: In-Reply-To: References: <20200210101811.18741-1-vit9696@protonmail.com> <20200210101811.18741-2-vit9696@protonmail.com> <_jqgwA58_jl6HqFJk6lb67C9nen1mEqrh_RbxOocaKH0G8J_QZ8mfAclsDvO-RcRB9YcmAtX8kNh2VJsFdPM9dTpvOgajbjZNKxsiOwGrBQ=@protonmail.com> <102EE286-A081-48D5-93FC-C1AB769B8D74@protonmail.com> <1601EE5ED9DEC05E.18513@groups.io> MIME-Version: 1.0 X-Spam-Status: No, score=-0.7 required=7.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,FREEMAIL_REPLYTO_END_DIGIT,HTML_FONT_LOW_CONTRAST, HTML_MESSAGE shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mail.protonmail.ch X-Groupsio-MsgNum: 57829 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha256; boundary="---------------------472ec824a05c8569dead40592a614b75"; charset=UTF-8 -----------------------472ec824a05c8569dead40592a614b75 Cc: "devel@edk2.groups.io" , Andrew Fish , Laszlo Ersek , =?utf-8?Q?Marvin_H=C3=A4user?= , "Kinney, Michael D" , "Ni, Ray" Content-Type: multipart/alternative; boundary="Apple-Mail=_C62CAB12-EDE8-4576-93A6-68EDCB77F97C" Date: Wed, 22 Apr 2020 19:55:44 +0300 From: vit9696 In-Reply-To: Message-Id: Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) References: <20200210101811.18741-1-vit9696@protonmail.com> <20200210101811.18741-2-vit9696@protonmail.com> <_jqgwA58_jl6HqFJk6lb67C9nen1mEqrh_RbxOocaKH0G8J_QZ8mfAclsDvO-RcRB9YcmAtX8kNh2VJsFdPM9dTpvOgajbjZNKxsiOwGrBQ=@protonmail.com> <102EE286-A081-48D5-93FC-C1AB769B8D74@protonmail.com> <1601EE5ED9DEC05E.18513@groups.io> <74Aq9y53Vum6ZvjqZLV3Mw-BNr6b8P2nJsH64WK1Kfi1Yt8hqNmAKcZuPoo-njPKz9MSEgNuTLCKF5xW4lXFEQ==@protonmail.conversationid> Subject: Re: [edk2-devel] [PATCH 1/1] ShellPkg: Add support for input with separately reported modifiers To: "Gao, Zhichao" , "Rothman, Michael A" X-Mailer: Apple Mail (2.3608.80.23.2.2) --Apple-Mail=_C62CAB12-EDE8-4576-93A6-68EDCB77F97C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Zhichao, We already build a customised shell for ourselves, but the problem with th= is change is that it is invasive. To make it work we need to patch EDK II, = and this is strongly undesired as maintaining EDK II patches is very tiring= . In fact, currently this is the only change we have that needs a patch in = EDK II. Since this particular change is something we believe should actuall= y be in EDK II, we decided to upstream it. In fact, there are really many mistakes in UEFI spec even besides this one= , but we do not know where to report them. E.g. last thing we saw was ByReg= isterNotify description in LocateHandleBuffer, which was mistakingly copy-p= asted from LocateHandle. Best regards, Vitaly > 22 =D0=B0=D0=BF=D1=80. 2020 =D0=B3., =D0=B2 04:55, Gao, Zhichao =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0=B0): >=20 > Hi Vitaly, > > I don=E2=80=99t know how to deal with such spec ambiguous issue. So I co= nsult Michael Rothman who is one of the owner of the UEFI spec. > BTW, you can=E2=80=99t change the firmware, why don=E2=80=99t you provid= e a specific shell spec build by yourselves to fix the issue. Is there any = limitation? > > Michael Rothman, > > Do you have a chance to view this issue? Just view the summary below is = enough. > > Thanks, > Zhichao > > From: vit9696 =20 > Sent: Saturday, April 18, 2020 2:14 AM > To: Gao, Zhichao ; Rothman, Michael A > Cc: devel@edk2.groups.io; Andrew Fish ; Laszlo Ersek ; Marvin H=C3=A4user ; Kinney, Michae= l D ; Ni, Ray > Subject: Re: [edk2-devel] [PATCH 1/1] ShellPkg: Add support for input wi= th separately reported modifiers > > Zhichao, > > This is correct. I did not notice the message previously, but otherwise = everything outlined here is accurate. Let me know if further input can be p= erformed from my side for this to land. > > Best regards, > Vitaly >=20 >=20 > 2 =D0=B0=D0=BF=D1=80. 2020 =D0=B3., =D0=B2 11:28, Gao, Zhichao > =D0=BD=D0=B0=D0=BF=D0=B8=D1= =81=D0=B0=D0=BB(=D0=B0): > > Summarize the issue, if anything incorrect, please help to correct it. T= hanks. > > Background: > Uefi spec ambiguous description: > > When interpreting the data from this function, it should be noted that= if a class > > of printable characters that are normally adjusted by shift modifiers = (e.g. Shift > > Key + "f" key) would be presented solely as a KeyData.Key.UnicodeChar = without the > > associated shift state. So in the previous example of a Shift Key + "f= " key being > > pressed, the only pertinent data returned would be KeyData.Key.Unicode= Char with > > the value of "F". This of course would not typically be the case for n= on-printable > > characters such as the pressing of the Right Shift Key + F10 key since= the > > corresponding returned data would be reflected both in the > > KeyData.KeyState.KeyShiftState and KeyData.Key.ScanCode values. > > Some firmware vendor see the =E2=80=9Cif=E2=80=9D as an option to implem= ent the keyboard driver and they choose to implement in the other way. > Ideal: shift + UnicodeKey/UnScancodeKey =3D=3D report as =3D=3D> =E2=80= =9Cshifted=E2=80=9D UnicodeKey/UnScancodeKey > Ctrl + UnicodeKey =3D=3D report as =3D=3D> UnicodeKey = =E2=80=93 =E2=80=98A=E2=80=99/=E2=80=99a=E2=80=99 + 1 > Other way: shift + UnicodeKey/UnScancodeKey =3D=3D report as =3D=3D> shi= ft state + =E2=80=9Cshifted=E2=80=9D UnicodeKey/UnScancodeKey > Ctrl + UnicodeKey =3D=3D report as =3D=3D> ctrl state + = UnicodeKey =E2=80=93 =E2=80=98A=E2=80=99/=E2=80=99a=E2=80=99 + 1 > I.e. do not remove the shift state. > That would cause the shell edit/Hexedit missing handling the =E2=80=9Csh= ifted=E2=80=9D key when run shell in such firmware. > > Vitaly=E2=80=99s solution add the support the handle =E2=80=9Cother impl= ementation=E2=80=9D. > > If we take Vitaly=E2=80=99s solution, we should fixed all the applicatio= ns in edk2 not only in shell edit/Hexeidt function. > And when we catch another request same with this issue, we would follow = the same progress. > > Thanks, > Zhichao > > From: devel@edk2.groups.io [mailto:devel@e= dk2.groups.io ] On Behalf Of Gao, Zhichao > Sent: Thursday, April 2, 2020 2:57 PM > To: devel@edk2.groups.io ; vit9696@protonma= il.com ; Rothman, Michael A > > Cc: Andrew Fish >; Laszlo Ersek= >; Marvin H=C3=A4user >; Kinney, Michael D >; Ni, Ray > > Subject: Re: [edk2-devel] [PATCH 1/1] ShellPkg: Add support for input wi= th separately reported modifiers > > Hi Micheal Rothman, > > Can you help to review this issue? Because of the uefi spec issue, some = firmware implemented the different behavior. > Should the edk2 code to handle such issue? If yes, here maybe the situat= ion: > 1. Change for all apps -> uefi spec update and accept such behavi= or with description -> Done. > 2. Change for all apps -> uefi spec update to remove the ambiguous= and reject other behavior -> removal the change in first step. > > Hi Vitaly, > > I used to think it is an additional support for different implementation= because of the spec. But if we approve this patch, all the app in edk2 usi= ng the combo key function should be update. > Using shell=E2=80=99s ctrl+=E2=80=99c=E2=80=99 as an example, it need to= update at the same time. Same with SCT tool. > > Thanks, > Zhichao > > From: devel@edk2.groups.io [mailto:devel@e= dk2.groups.io ] On Behalf Of Vitaly Cheptsov v= ia Groups.Io > Sent: Friday, March 27, 2020 7:01 PM > To: Gao, Zhichao > > Cc: devel@edk2.groups.io ; Andrew Fish >; Laszlo Ersek >; Marvin H=C3=A4user >; Kinney, Michael D >; Ni, Ray > > Subject: Re: [edk2-devel] [PATCH 1/1] ShellPkg: Add support for input wi= th separately reported modifiers > > Hello, > > Requesting to merge this into edk2-stable202005 for the reasons explaine= d in BZ[1]. I assume there is no real objection for this, only the approach= we make such changes in the future, but this can be postponed as we encoun= ter more of such problems. > > Best regards, > Vitaly > > [1] https://bugzilla.tianocore.org/show_bug.cgi?id=3D2510 > >=20 > 20 =D1=84=D0=B5=D0=B2=D1=80. 2020 =D0=B3., =D0=B2 03:27, Gao, Zhichao > =D0=BD=D0=B0=D0=BF=D0= =B8=D1=81=D0=B0=D0=BB(=D0=B0): > > Sorry for my mistake. Then I have no other comments for this patch. > Reviewed-by: Zhichao Gao > > > Thanks, > Zhichao > > <>From: vit9696 = >=20 > Sent: Wednesday, February 19, 2020 8:15 PM > To: Gao, Zhichao >;= devel@edk2.groups.io > Subject: RE: [edk2-devel] [PATCH 1/1] ShellPkg: Add support for input wi= th separately reported modifiers > > Zhichao, > > Thanks for your review. The comment is correct, as ShiftOnlyState means = the state where only shift (and no other modifiers) can be pressed or not. > > Best wishes, > Vitaly > > On Wed, Feb 19, 2020 at 09:55, Gao, Zhichao > wrote: > Hi Vitaly, >=20 > See the comment below: >=20 > > -----Original Message----- > > From: devel@edk2.groups.io > On Behalf Of Vitaly > > Cheptsov via Groups.Io > > Sent: Monday, February 10, 2020 6:18 PM > > To: devel@edk2.groups.io > > Subject: [edk2-devel] [PATCH 1/1] ShellPkg: Add support for input with > > separately reported modifiers > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2510 > > > > Some firmwares: > > - Report Shift modifier even when they report upper-case unicode lette= r. > > - Report Ctrl modifier with "shifted" UniChar (i.e. X - 'A' + 1). > > > > This change provides support for these firmwares preserving the compat= ibility > > with the previous input handling. > > > > Signed-off-by: Michael Belyaev > > > Reviewed-by: Vitaly Cheptsov > > > --- > > ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c | 37 > > ++++++++++++++------ > > ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.c | 28 > > ++++++++++----- > > ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c | 6 ++++ > > ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c | = 11 > > +++--- > > 4 files changed, 58 insertions(+), 24 deletions(-) > > > > diff --git > > a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c > > b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c > > index df530f1119..9615a4dfbd 100644 > > --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.= c > > +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.= c > > @@ -1381,8 +1381,8 @@ MainCommandDisplayHelp ( > > continue; > > } > > > > - if (((KeyData.KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) =3D=3D= 0) || > > - (KeyData.KeyState.KeyShiftState =3D=3D EFI_SHIFT_STATE_VALID)) { > > + 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/report shift state, > > // CTRL+W is translated to L'W' - L'A' + 1. > > @@ -1390,14 +1390,17 @@ MainCommandDisplayHelp ( > > if (KeyData.Key.UnicodeChar =3D=3D L'W' - L'A' + 1) { > > break; > > } > > - } else if (((KeyData.KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID)= !=3D 0) > > && > > - ((KeyData.KeyState.KeyShiftState & (EFI_LEFT_CONTROL_PRESSED | > > EFI_RIGHT_CONTROL_PRESSED)) !=3D 0) && > > - ((KeyData.KeyState.KeyShiftState & ~(EFI_SHIFT_STATE_VALID | > > EFI_LEFT_CONTROL_PRESSED | EFI_RIGHT_CONTROL_PRESSED)) =3D=3D 0)) { > > + } else if (((KeyData.KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID)= !=3D 0) > > + && ((KeyData.KeyState.KeyShiftState & (EFI_LEFT_CONTROL_PRESSED | > > EFI_RIGHT_CONTROL_PRESSED)) !=3D 0) > > + && ((KeyData.KeyState.KeyShiftState & > > + ~(EFI_SHIFT_STATE_VALID | EFI_LEFT_CONTROL_PRESSED | > > + EFI_RIGHT_CONTROL_PRESSED)) =3D=3D 0)) { > > // > > // For consoles that supports/reports shift state, > > // make sure that only CONTROL shift key is pressed. > > + // For some consoles that report shift state, > > + // CTRL+W is still translated to L'W' - L'A' + 1. > > // > > - if ((KeyData.Key.UnicodeChar =3D=3D 'w') || (KeyData.Key.UnicodeChar= =3D=3D 'W')) > > { > > + if ((KeyData.Key.UnicodeChar =3D=3D L'w') || (KeyData.Key.UnicodeCha= r =3D=3D L'W') > > + || (KeyData.Key.UnicodeChar =3D=3D L'w' - L'a' + 1) || > > + (KeyData.Key.UnicodeChar =3D=3D L'W' - L'A' + 1)) { > > break; > > } > > } > > @@ -1834,7 +1837,8 @@ MainEditorKeyInput ( > > EFI_KEY_DATA KeyData; > > EFI_STATUS Status; > > EFI_SIMPLE_POINTER_STATE MouseState; > > - BOOLEAN NoShiftState; > > + BOOLEAN NoModifierState; > > + BOOLEAN ShiftOnlyState; > > > > do { > > > > @@ -1886,17 +1890,28 @@ MainEditorKeyInput ( > > // > > StatusBarSetRefresh(); > > // > > - // NoShiftState: TRUE when no shift key is pressed. > > + // NoModifierState: TRUE when no modifier key is pressed. > > // > > - NoShiftState =3D ((KeyData.KeyState.KeyShiftState & > > EFI_SHIFT_STATE_VALID) =3D=3D 0) || (KeyData.KeyState.KeyShiftState = =3D=3D > > EFI_SHIFT_STATE_VALID); > > + NoModifierState =3D ((KeyData.KeyState.KeyShiftState & > > EFI_SHIFT_STATE_VALID) =3D=3D 0) > > + || (KeyData.KeyState.KeyShiftState =3D=3D EFI_SHIFT_STATE_VALID); > > + // > > + // ShiftOnlyState: TRUE when no modifier key except Shift is pressed= . > > + // > > + ShiftOnlyState =3D ((KeyData.KeyState.KeyShiftState & > > EFI_SHIFT_STATE_VALID) =3D=3D 0) > > + || ((KeyData.KeyState.KeyShiftState > > + & ~(EFI_SHIFT_STATE_VALID | > > + EFI_LEFT_SHIFT_PRESSED | EFI_RIGHT_SHIFT_PRESSED)) =3D=3D 0); > > // > > // dispatch to different components' key handling function > > // > > if (EFI_NOT_FOUND !=3D MenuBarDispatchControlHotKey(&KeyData)) { > > Status =3D EFI_SUCCESS; > > - } else if (NoShiftState && ((KeyData.Key.ScanCode =3D=3D SCAN_NULL) = || > > ((KeyData.Key.ScanCode >=3D SCAN_UP) && (KeyData.Key.ScanCode <=3D > > SCAN_PAGE_DOWN)))) { > > + } else if ((ShiftOnlyState && (KeyData.Key.ScanCode =3D=3D SCAN_NULL= )) > > + || (NoModifierState && (KeyData.Key.ScanCode >=3D SCAN_UP) && > > (KeyData.Key.ScanCode <=3D SCAN_PAGE_DOWN))) { > > + // > > + // alphanumeric keys with or without shift, or arrow keys without sh= ift > > + // >=20 > This is unmatched with the comments. It only handles the alphanumeric ke= ys with shift. >=20 > Thanks, > Zhichao >=20 > > Status =3D FileBufferHandleInput (&KeyData.Key); > > - } else if (NoShiftState && (KeyData.Key.ScanCode >=3D SCAN_F1) && > > (KeyData.Key.ScanCode <=3D SCAN_F12)) { > > + } else if (NoModifierState && (KeyData.Key.ScanCode >=3D SCAN_F1) > > + && (KeyData.Key.ScanCode <=3D SCAN_F12)) { > > Status =3D MenuBarDispatchFunctionKey (&KeyData.Key); > > } else { > > StatusBarSetStatusString (L"Unknown Command"); diff --git > > a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.c > > b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.c > > index 35b0b701e8..d053059220 100644 > > --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.c > > +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.c > > @@ -130,6 +130,8 @@ InputBarRefresh ( > > UINTN EventIndex; > > UINTN CursorRow; > > UINTN CursorCol; > > + BOOLEAN ShiftPressed; > > + BOOLEAN ModifiersPressed; > > > > // > > // variable initialization > > @@ -180,17 +182,23 @@ InputBarRefresh ( > > if (EFI_ERROR (Status)) { > > continue; > > } > > - if (((KeyData.KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) !=3D 0= ) && > > - (KeyData.KeyState.KeyShiftState !=3D EFI_SHIFT_STATE_VALID)) { > > - // > > - // Shift key pressed. > > - // > > + ModifiersPressed =3D ((KeyData.KeyState.KeyShiftState & > > EFI_SHIFT_STATE_VALID) !=3D 0) > > + && (KeyData.KeyState.KeyShiftState !=3D > > + EFI_SHIFT_STATE_VALID); > > + > > + // > > + // TRUE if Shift is pressed and no other modifiers are pressed > > + // > > + ShiftPressed =3D ModifiersPressed && > > + ((KeyData.KeyState.KeyShiftState & > > + ~(EFI_SHIFT_STATE_VALID | EFI_LEFT_SHIFT_PRESSED | > > + EFI_RIGHT_SHIFT_PRESSED)) =3D=3D 0); > > + > > + if (ModifiersPressed && !ShiftPressed) { > > continue; > > } > > // > > // pressed ESC > > // > > - if (KeyData.Key.ScanCode =3D=3D SCAN_ESC) { > > + if (!ModifiersPressed && KeyData.Key.ScanCode =3D=3D SCAN_ESC) { > > Size =3D 0; > > Status =3D EFI_NOT_READY; > > break; > > @@ -198,9 +206,10 @@ InputBarRefresh ( > > // > > // return pressed > > // > > - if (KeyData.Key.UnicodeChar =3D=3D CHAR_LINEFEED || > > KeyData.Key.UnicodeChar =3D=3D CHAR_CARRIAGE_RETURN) { > > + if (!ModifiersPressed > > + && (KeyData.Key.UnicodeChar =3D=3D CHAR_LINEFEED || > > + KeyData.Key.UnicodeChar =3D=3D CHAR_CARRIAGE_RETURN)) { > > break; > > - } else if (KeyData.Key.UnicodeChar =3D=3D CHAR_BACKSPACE) { > > + } else if (!ModifiersPressed && KeyData.Key.UnicodeChar =3D=3D > > + CHAR_BACKSPACE) { > > // > > // backspace > > // > > @@ -213,7 +222,8 @@ InputBarRefresh ( > > > > } > > } > > - } else if (KeyData.Key.UnicodeChar <=3D 127 && KeyData.Key.UnicodeCh= ar >=3D > > 32) { > > + } else if ((!ModifiersPressed || ShiftPressed) > > + && KeyData.Key.UnicodeChar <=3D 127 && > > + KeyData.Key.UnicodeChar >=3D 32) { > > // > > // VALID ASCII char pressed > > // > > diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c > > b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c > > index ca8bc506d9..eabbf3c571 100644 > > --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c > > +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c > > @@ -190,11 +190,17 @@ MenuBarDispatchControlHotKey ( > > // > > // For consoles that supports/reports shift state, > > // make sure only CONTROL is pressed. > > + // For some consoles that report shift state, > > + // Ctrl+A is still translated to 1 (UnicodeChar). > > // > > if ((KeyData->Key.UnicodeChar >=3D L'A') && (KeyData->Key.UnicodeChar = <=3D > > L'Z')) { > > ControlIndex =3D KeyData->Key.UnicodeChar - L'A' + 1; > > } else if ((KeyData->Key.UnicodeChar >=3D L'a') && (KeyData->Key.Unico= deChar > > <=3D L'z')) { > > ControlIndex =3D KeyData->Key.UnicodeChar - L'a' + 1; > > + } else if ((KeyData->Key.UnicodeChar >=3D L'A' - L'A' + 1) && (KeyDa= ta- > > >Key.UnicodeChar <=3D L'Z' - L'A' + 1)) { > > + ControlIndex =3D KeyData->Key.UnicodeChar; > > + } else if ((KeyData->Key.UnicodeChar >=3D L'a' - L'a' + 1) && (KeyDa= ta- > > >Key.UnicodeChar <=3D L'z' - L'z' + 1)) { > > + ControlIndex =3D KeyData->Key.UnicodeChar; > > } > > } > > if ((SCAN_CONTROL_Z < ControlIndex) > > diff --git > > a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c > > b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c > > index a00df49d38..394e531c16 100644 > > --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEdito= r.c > > +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEdito= r. > > +++ c > > @@ -137,14 +137,17 @@ HMainCommandDisplayHelp ( > > if (KeyData.Key.UnicodeChar =3D=3D L'W' - L'A' + 1) { > > break; > > } > > - } else if (((KeyData.KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID)= !=3D 0) > > && > > - ((KeyData.KeyState.KeyShiftState & (EFI_LEFT_CONTROL_PRESSED | > > EFI_RIGHT_CONTROL_PRESSED)) !=3D 0) && > > - ((KeyData.KeyState.KeyShiftState & ~(EFI_SHIFT_STATE_VALID | > > EFI_LEFT_CONTROL_PRESSED | EFI_RIGHT_CONTROL_PRESSED)) =3D=3D 0)) { > > + } else if (((KeyData.KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID)= !=3D 0) > > + && ((KeyData.KeyState.KeyShiftState & (EFI_LEFT_CONTROL_PRESSED | > > EFI_RIGHT_CONTROL_PRESSED)) !=3D 0) > > + && ((KeyData.KeyState.KeyShiftState & > > + ~(EFI_SHIFT_STATE_VALID | EFI_LEFT_CONTROL_PRESSED | > > + EFI_RIGHT_CONTROL_PRESSED)) =3D=3D 0)) { > > // > > // For consoles that supports/reports shift state, > > // make sure that only CONTROL shift key is pressed. > > + // For some consoles that report shift state, > > + // CTRL+W is still translated to L'W' - L'A' + 1. > > // > > - if ((KeyData.Key.UnicodeChar =3D=3D 'w') || (KeyData.Key.UnicodeChar= =3D=3D 'W')) > > { > > + if ((KeyData.Key.UnicodeChar =3D=3D 'w') || (KeyData.Key.UnicodeChar= =3D=3D 'W') > > + || (KeyData.Key.UnicodeChar =3D=3D L'w' - L'a' + 1) || > > + (KeyData.Key.UnicodeChar =3D=3D L'W' - L'A' + 1)) { > > break; > > } > > } > > -- > > 2.21.1 (Apple Git-122.3) > > > > > > -=3D-=3D-=3D-=3D-=3D-=3D > > Groups.io Links: You receive all messages sent to = this group. > > > > View/Reply Online (#54122): https://edk2.groups.io/g/devel/message/541= 22 > > Mute This Topic: https://groups.io/mt/71133729/1768756 > > Group Owner: devel+owner@edk2.groups.io > > Unsubscribe: https://edk2.groups.io/g/devel/unsub [zhichao.gao@intel.com ] > > -=3D-=3D-=3D-=3D-=3D-=3D >=20 > >=20 --Apple-Mail=_C62CAB12-EDE8-4576-93A6-68EDCB77F97C Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Zhichao,
<= br class=3D"">
We already build a customised shell for= ourselves, but the problem with this change is that it is invasive. To mak= e it work we need to patch EDK II, and this is strongly undesired as mainta= ining EDK II patches is very tiring. In fact, currently this is the only ch= ange we have that needs a patch in EDK II. Since this particular change is = something we believe should actually be in EDK II, we decided to upstream i= t.

In fact, there= are really many mistakes in UEFI spec even besides this one, but we do not= know where to report them. E.g. last thing we saw was ByRegisterNotify des= cription in LocateHandleBuffer, which was mistakingly copy-pasted from=  LocateHandle.

Best regards,
Vitaly

22 =D0=B0=D0=BF= = =D1=80. 2020 =D0=B3., =D0=B2 04:55, Gao, Zhichao <zhichao.gao@intel.com> =D0=BD=D0=B0= =D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0=B0):

Hi Vitaly,
 
I don=E2=80=99t know how to deal with such sp= ec ambiguous issue. So I consult Michael Rothman who is one of the owner of= the UEFI spec.
BTW,= you can=E2=80=99t change the firmware, why don=E2=80=99t you provide a spe= cific shell spec build by yourselves to fix the issue. Is there any limitat= ion?
 
Michael Rothman,
 =
Do you have a chance to view this issue? = Just view the summary below is enough.
 
Thanks,
Zhich= ao
&= nbsp;
From:<= span class=3D"Apple-converted-space"> vit9696 <vit9696@protonmail.com> 
= Sent: Saturday, April= 18, 2020 2:14 AM
To: Gao, Zhichao <zhichao.gao@intel.com>; Rothman, Michael A &l= t;michael.a.rothm= an@intel.com>
Cc: devel@edk2.groups.io; Andrew Fish <afish@apple.com>; Laszlo Ersek <lersek@redhat.com>; Marvin H=C3= =A4user <mhaeuser@out= look.de>; Kinney, Michael D <michael.d.kinney@intel.com>; Ni, Ray <ray.ni@intel.com>
Subject:&nbs= p;Re: [edk2-devel] [PATCH 1/1] ShellPkg: Add support for input with = separately reported modifiers
 
Zhichao,
 
This is correct. I did not notice the message previo= usly, but otherwise everything outlined here is accurate. Let me know if fu= rther input can be performed from my side for this to land.=
 
Best= regards,
Vitaly


2 =D0=B0=D0=BF=D1=80. 2020 =D0=B3., = =D0=B2 11:28, Gao, Zhichao <zhichao.gao@i= ntel.com> =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0=B0):
&nbs= p;
<= span style=3D"color: rgb(31, 73, 125);" class=3D"">Summarize the issue, if = anything incorrect, please help to correct it. Thanks.
&nbs= p;
Background:
Uefi spec ambiguous description:
> When interpreting the data from this function, it should = be noted that if a class
> of printable characters tha= t are normally adjusted by shift modifiers (e.g. Shift
> Key + "f" key) would be presented solely as a KeyData.Key.UnicodeCh= ar without the
<= /div>
> associated shift state. So in the pre= vious example of a Shift Key + "f" key being
> pres= sed, the only pertinent data returned would be KeyData.Key.UnicodeChar with=
> the value of "F". This of course would not typicall= y be the case for non-printable
> characters such as t= he pressing of the Right Shift Key + F10 key since the
> corresponding returned data would be reflected both in the
> KeyData.KeyState.KeyShiftState and KeyData.Key.ScanCode valu= es.
 =
Some firmware vendor see the =E2=80=9Cif= =E2=80=9D as an option to implement the keyboard driver and they choose to= implement in the other way.=
Ideal: shift + UnicodeKey/UnScanc= odeKey =3D=3D report as =3D=3D> =E2=80=9Cshifted=E2=80=9D UnicodeKey/UnS= cancodeKey
         = ;       Ctrl + UnicodeKey =3D=3D report as = =3D=3D> UnicodeKey =E2=80=93 =E2=80=98A=E2=80=99/=E2=80=99a=E2=80=99 + = 1
Other way: shift + UnicodeKey/UnScancodeKey =3D=3D report as = =3D=3D> shift state + =E2=80=9Cshifted=E2=80=9D UnicodeKey/UnScancodeKe= y
          &n= bsp;     Ctrl + UnicodeKey =3D=3D report as =3D=3D> = ctrl state + UnicodeKey =E2=80=93 =E2=80=98A=E2=80=99/=E2=80=99a=E2=80=99 += 1
I.e. do not remove the shift state.<= o:p class=3D"">
That would cau= se the shell edit/Hexedit missing handling the =E2=80=9Cshifted=E2=80=9D ke= y when run shell in such firmware.=
 
Vitaly=E2= =80=99s solution add the support the handle =E2=80=9Cother implementation= =E2=80=9D.
 
If we take Vitaly=E2=80=99s solut= ion, we should fixed all the applications in edk2 not only in shell edit/He= xeidt function.
=
And when we catch another request same with this= issue, we would follow the same progress.
 
Tha= nks,
Zhichao
 
Hi Micheal Rothman,
Hello,
 = ;
Requesting to merge th= is into edk2-stable202005 for the reasons explained in BZ[1]. I assume= there is no real objection for this, only the approach we make such change= s in the future, but this can be postponed as we encounter more of such pro= blems.
 
Best regards,
Vitaly
 
[1] https://bugzilla.tianocore.org/show_bug.cgi?id=3D2510

 

20 =D1=84=D0=B5=D0=B2=D1=80. 2020 =D0=B3., =D0=B2 03:27, Gao, Zhicha= o <zhichao.gao@intel.com> =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0= =B0=D0=BB(=D0=B0):
 =
Sorry for my mistake. Then I have no other commen= ts for this patch.
Reviewe= d-by: Zhichao Gao <zhichao.gao@intel.com><= o:p class=3D"">
 
Thanks,
Zhicha= o
 =
<= div style=3D"margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibr= i, sans-serif;" class=3D""><= b class=3D"">From: vi= t9696 <vit9696@protonmail.com> 
Sent: Wednesday, February 19, 2020 8:15 PMTo:&nb= sp;Gao, Zhichao <= zhichao.gao@intel.com>; devel@edk2.groups.io
Subject:&n= bsp;RE: [edk2-devel] [PATCH 1/1] ShellPkg: Add support for input wit= h separately reported modifiers
 
Zhichao,<= /div>
 
<= div style=3D"margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibr= i, sans-serif;" class=3D"">Thanks for your review. The comment is correct, = as ShiftOnlyState means the state where only shift (and no other modifiers)= can be pressed or not.
 
Best wishes,=
Vitaly=
 
On Wed, Feb 19, 2020 at 09:55, Gao, Zhichao <zhichao.gao= @intel.com> wrote:

Hi Vitaly,

See the comment below:

&= gt; -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On = Behalf Of Vitaly
> Cheptsov via Groups.Io
&g= t; Sent: Monday, February 10, 2020 6:18 PM
> To: devel@edk2.groups.io
> Subject: [edk2-devel] [PATCH 1/1] ShellPkg: Add support for i= nput with
> separately reported modifiers
&g= t;
> REF: = https://bugzilla.tianocore.org/show_bug.cgi?id=3D2510
>
> Some firmwares:
> - Report Shift modifier even when they report upper-case unico= de letter.
> - Report Ctrl modifier with "shifted" UniChar= (i.e. X - 'A' + 1).
>
> This change prov= ides support for these firmwares preserving the compatibility
> with the previous input handling.
>
&g= t; Signed-off-by: Michael Belyaev <usrsse2@icloud.com>
> Reviewed-by: Vitaly Cheptsov <vit9696@protonmail.com>
> ---
> ShellPkg/Library/UefiShell= Debug1CommandsLib/Edit/MainTextEditor.c | 37
> +++++++++++= +++------
> ShellPkg/Library/UefiShellDebug1CommandsLib/Ed= itInputBar.c | 28
> ++++++++++-----
> She= llPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c | 6 ++++
> ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c= | 11
> +++---
> 4 files changed, 58 inse= rtions(+), 24 deletions(-)
>
> diff --git=
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Main= TextEditor.c
> b/ShellPkg/Library/UefiShellDebug1CommandsL= ib/Edit/MainTextEditor.c
> index df530f1119..9615a4dfbd 10= 0644
> --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/E= dit/MainTextEditor.c
> +++ b/ShellPkg/Library/UefiShellDeb= ug1CommandsLib/Edit/MainTextEditor.c
> @@ -1381,8 +1381,8 = @@ MainCommandDisplayHelp (
> continue;
>= }
>
> - if (((KeyData.KeyState.KeyShiftS= tate & EFI_SHIFT_STATE_VALID) =3D=3D 0) ||
> - (KeyDat= a.KeyState.KeyShiftState =3D=3D EFI_SHIFT_STATE_VALID)) {
>= ; + if (((KeyData.KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) =3D= =3D 0)
> + || (KeyData.KeyState.KeyShiftState =3D=3D EFI_= SHIFT_STATE_VALID)) {
> //
> // For conso= les that don't support/report shift state,
> // CTRL+W is = translated to L'W' - L'A' + 1.
> @@ -1390,14 +1390,17 @@ M= ainCommandDisplayHelp (
> if (KeyData.Key.UnicodeChar =3D= =3D L'W' - L'A' + 1) {
> break;
> }
> - } else if (((KeyData.KeyState.KeyShiftState & EFI_SHIF= T_STATE_VALID) !=3D 0)
> &&
> - (= (KeyData.KeyState.KeyShiftState & (EFI_LEFT_CONTROL_PRESSED |
> EFI_RIGHT_CONTROL_PRESSED)) !=3D 0) &&
&g= t; - ((KeyData.KeyState.KeyShiftState & ~(EFI_SHIFT_STATE_VALID |
> EFI_LEFT_CONTROL_PRESSED | EFI_RIGHT_CONTROL_PRESSED)) =3D=3D= 0)) {
> + } else if (((KeyData.KeyState.KeyShiftState &am= p; EFI_SHIFT_STATE_VALID) !=3D 0)
> + && ((KeyData= .KeyState.KeyShiftState & (EFI_LEFT_CONTROL_PRESSED |
>= ; EFI_RIGHT_CONTROL_PRESSED)) !=3D 0)
> + && ((Key= Data.KeyState.KeyShiftState &
> + ~(EFI_SHIFT_STATE_VA= LID | EFI_LEFT_CONTROL_PRESSED |
> + EFI_RIGHT_CONTROL_PRE= SSED)) =3D=3D 0)) {
> //
> // For console= s that supports/reports shift state,
> // make sure that o= nly CONTROL shift key is pressed.
> + // For some consoles= that report shift state,
> + // CTRL+W is still translate= d to L'W' - L'A' + 1.
> //
> - if ((KeyDa= ta.Key.UnicodeChar =3D=3D 'w') || (KeyData.Key.UnicodeChar =3D=3D 'W'))
> {
> + if ((KeyData.Key.UnicodeChar =3D=3D = L'w') || (KeyData.Key.UnicodeChar =3D=3D L'W')
> + || (Key= Data.Key.UnicodeChar =3D=3D L'w' - L'a' + 1) ||
> + (KeyDa= ta.Key.UnicodeChar =3D=3D L'W' - L'A' + 1)) {
> break;
> }
> }
> @@ -1834,7 +1837,= 8 @@ MainEditorKeyInput (
> EFI_KEY_DATA KeyData;
> EFI_STATUS Status;
> EFI_SIMPLE_POINTER_STATE = MouseState;
> - BOOLEAN NoShiftState;
> += BOOLEAN NoModifierState;
> + BOOLEAN ShiftOnlyState;
>
> do {
>
>= ; @@ -1886,17 +1890,28 @@ MainEditorKeyInput (
> //
> StatusBarSetRefresh();
> //
>= ; - // NoShiftState: TRUE when no shift key is pressed.
> = + // NoModifierState: TRUE when no modifier key is pressed.
&= gt; //
> - NoShiftState =3D ((KeyData.KeyState.KeyShiftSta= te &
> EFI_SHIFT_STATE_VALID) =3D=3D 0) || (KeyData.Ke= yState.KeyShiftState =3D=3D
> EFI_SHIFT_STATE_VALID);
> + NoModifierState =3D ((KeyData.KeyState.KeyShiftState &=
> EFI_SHIFT_STATE_VALID) =3D=3D 0)
> + |= | (KeyData.KeyState.KeyShiftState =3D=3D EFI_SHIFT_STATE_VALID);
> + //
> + // ShiftOnlyState: TRUE when no modif= ier key except Shift is pressed.
> + //
>= + ShiftOnlyState =3D ((KeyData.KeyState.KeyShiftState &
= > EFI_SHIFT_STATE_VALID) =3D=3D 0)
> + || ((KeyData.Key= State.KeyShiftState
> + & ~(EFI_SHIFT_STATE_VALID |> + EFI_LEFT_SHIFT_PRESSED | EFI_RIGHT_SHIFT_PRESSED)) =3D= =3D 0);
> //
> // dispatch to different = components' key handling function
> //
> = if (EFI_NOT_FOUND !=3D MenuBarDispatchControlHotKey(&KeyData)) {
> Status =3D EFI_SUCCESS;
> - } else if (NoShif= tState && ((KeyData.Key.ScanCode =3D=3D SCAN_NULL) ||
> ((KeyData.Key.ScanCode >=3D SCAN_UP) && (KeyData.Key.ScanC= ode <=3D
> SCAN_PAGE_DOWN)))) {
> + } = else if ((ShiftOnlyState && (KeyData.Key.ScanCode =3D=3D SCAN_NULL)= )
> + || (NoModifierState && (KeyData.Key.ScanCode= >=3D SCAN_UP) &&
> (KeyData.Key.ScanCode <= =3D SCAN_PAGE_DOWN))) {
> + //
> + // al= phanumeric keys with or without shift, or arrow keys without shift
> + //

This is unmatched with the co= mments. It only handles the alphanumeric keys with shift.
Thanks,
Zhichao

>= Status =3D FileBufferHandleInput (&KeyData.Key);
> - = } else if (NoShiftState && (KeyData.Key.ScanCode >=3D SCAN_F1) &= amp;&
> (KeyData.Key.ScanCode <=3D SCAN_F12)) {
> + } else if (NoModifierState && (KeyData.Key.ScanCo= de >=3D SCAN_F1)
> + && (KeyData.Key.ScanCode &= lt;=3D SCAN_F12)) {
> Status =3D MenuBarDispatchFunctionKe= y (&KeyData.Key);
> } else {
> Status= BarSetStatusString (L"Unknown Command"); diff --git
> a/Sh= ellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.c
>= b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.c
> index 35b0b701e8..d053059220 100644
> --- a/ShellPkg= /Library/UefiShellDebug1CommandsLib/EditInputBar.c
> +++ b= /ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.c
&= gt; @@ -130,6 +130,8 @@ InputBarRefresh (
> UINTN EventInd= ex;
> UINTN CursorRow;
> UINTN CursorCol;=
> + BOOLEAN ShiftPressed;
> + BOOLEAN Mo= difiersPressed;
>
> //
>= // variable initialization
> @@ -180,17 +182,23 @@ InputB= arRefresh (
> if (EFI_ERROR (Status)) {
>= continue;
> }
> - if (((KeyData.KeyState= .KeyShiftState & EFI_SHIFT_STATE_VALID) !=3D 0) &&
> - (KeyData.KeyState.KeyShiftState !=3D EFI_SHIFT_STATE_VALID)) {
> - //
> - // Shift key pressed.
> - //
> + ModifiersPressed =3D ((KeyData.KeyState.K= eyShiftState &
> EFI_SHIFT_STATE_VALID) !=3D 0)
> + && (KeyData.KeyState.KeyShiftState !=3D
> + EFI_SHIFT_STATE_VALID);
> +
> + = //
> + // TRUE if Shift is pressed and no other modifiers = are pressed
> + //
> + ShiftPressed =3D M= odifiersPressed &&
> + ((KeyData.KeyState.KeyShift= State &
> + ~(EFI_SHIFT_STATE_VALID | EFI_LEFT_SHIFT_P= RESSED |
> + EFI_RIGHT_SHIFT_PRESSED)) =3D=3D 0);
> +
> + if (ModifiersPressed && !ShiftPr= essed) {
> continue;
> }
&g= t; //
> // pressed ESC
> //
> - if (KeyData.Key.ScanCode =3D=3D SCAN_ESC) {
> + if= (!ModifiersPressed && KeyData.Key.ScanCode =3D=3D SCAN_ESC) {
> Size =3D 0;
> Status =3D EFI_NOT_READY;
> break;
> @@ -198,9 +206,10 @@ InputBarRefr= esh (
> //
> // return pressed
> //
> - if (KeyData.Key.UnicodeChar =3D=3D CHAR= _LINEFEED ||
> KeyData.Key.UnicodeChar =3D=3D CHAR_CARRIAG= E_RETURN) {
> + if (!ModifiersPressed
> += && (KeyData.Key.UnicodeChar =3D=3D CHAR_LINEFEED ||
= > + KeyData.Key.UnicodeChar =3D=3D CHAR_CARRIAGE_RETURN)) {
> break;
> - } else if (KeyData.Key.UnicodeChar =3D= =3D CHAR_BACKSPACE) {
> + } else if (!ModifiersPressed &a= mp;& KeyData.Key.UnicodeChar =3D=3D
> + CHAR_BACKSPACE= ) {
> //
> // backspace
>= ; //
> @@ -213,7 +222,8 @@ InputBarRefresh (
>
> }
> }
> - } else= if (KeyData.Key.UnicodeChar <=3D 127 && KeyData.Key.UnicodeChar= >=3D
> 32) {
> + } else if ((!Modifie= rsPressed || ShiftPressed)
> + && KeyData.Key.Unic= odeChar <=3D 127 &&
> + KeyData.Key.UnicodeChar= >=3D 32) {
> //
> // VALID ASCII char= pressed
> //
> diff --git a/ShellPkg/Lib= rary/UefiShellDebug1CommandsLib/EditMenuBar.c
> b/ShellPkg= /Library/UefiShellDebug1CommandsLib/EditMenuBar.c
> index = ca8bc506d9..eabbf3c571 100644
> --- a/ShellPkg/Library/Uef= iShellDebug1CommandsLib/EditMenuBar.c
> +++ b/ShellPkg/Lib= rary/UefiShellDebug1CommandsLib/EditMenuBar.c
> @@ -190,11= +190,17 @@ MenuBarDispatchControlHotKey (
> //
> // For consoles that supports/reports shift state,
> // make sure only CONTROL is pressed.
> + // For so= me consoles that report shift state,
> + // Ctrl+A is stil= l translated to 1 (UnicodeChar).
> //
> i= f ((KeyData->Key.UnicodeChar >=3D L'A') && (KeyData->Key.U= nicodeChar <=3D
> L'Z')) {
> ControlIn= dex =3D KeyData->Key.UnicodeChar - L'A' + 1;
> } else i= f ((KeyData->Key.UnicodeChar >=3D L'a') && (KeyData->Key.U= nicodeChar
> <=3D L'z')) {
> ControlIn= dex =3D KeyData->Key.UnicodeChar - L'a' + 1;
> + } else= if ((KeyData->Key.UnicodeChar >=3D L'A' - L'A' + 1) && (KeyD= ata-
> >Key.UnicodeChar <=3D L'Z' - L'A' + 1)) {
> + ControlIndex =3D KeyData->Key.UnicodeChar;
> + } else if ((KeyData->Key.UnicodeChar >=3D L'a' - L'a' + 1) = && (KeyData-
> >Key.UnicodeChar <=3D L'z' - = L'z' + 1)) {
> + ControlIndex =3D KeyData->Key.UnicodeC= har;
> }
> }
> if ((SCAN= _CONTROL_Z < ControlIndex)
> diff --git
&= gt; a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c> b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Mai= nHexEditor.c
> index a00df49d38..394e531c16 100644
> --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainH= exEditor.c
> +++ b/ShellPkg/Library/UefiShellDebug1Command= sLib/HexEdit/MainHexEditor.
> +++ c
> @@ = -137,14 +137,17 @@ HMainCommandDisplayHelp (
> if (KeyData= .Key.UnicodeChar =3D=3D L'W' - L'A' + 1) {
> break;
> }
> - } else if (((KeyData.KeyState.KeyShiftS= tate & EFI_SHIFT_STATE_VALID) !=3D 0)
> &&
> - ((KeyData.KeyState.KeyShiftState & (EFI_LEFT_CONTROL_= PRESSED |
> EFI_RIGHT_CONTROL_PRESSED)) !=3D 0) &&=
> - ((KeyData.KeyState.KeyShiftState & ~(EFI_SHIFT_ST= ATE_VALID |
> EFI_LEFT_CONTROL_PRESSED | EFI_RIGHT_CONTROL= _PRESSED)) =3D=3D 0)) {
> + } else if (((KeyData.KeyState.= KeyShiftState & EFI_SHIFT_STATE_VALID) !=3D 0)
> + &am= p;& ((KeyData.KeyState.KeyShiftState & (EFI_LEFT_CONTROL_PRESSED |<= br class=3D"">> EFI_RIGHT_CONTROL_PRESSED)) !=3D 0)
> += && ((KeyData.KeyState.KeyShiftState &
> + ~(E= FI_SHIFT_STATE_VALID | EFI_LEFT_CONTROL_PRESSED |
> + EFI_= RIGHT_CONTROL_PRESSED)) =3D=3D 0)) {
> //
&g= t; // For consoles that supports/reports shift state,
> //= make sure that only CONTROL shift key is pressed.
> + // = For some consoles that report shift state,
> + // CTRL+W i= s still translated to L'W' - L'A' + 1.
> //
= > - if ((KeyData.Key.UnicodeChar =3D=3D 'w') || (KeyData.Key.UnicodeChar= =3D=3D 'W'))
> {
> + if ((KeyData.Key.Un= icodeChar =3D=3D 'w') || (KeyData.Key.UnicodeChar =3D=3D 'W')
> + || (KeyData.Key.UnicodeChar =3D=3D L'w' - L'a' + 1) ||
> + (KeyData.Key.UnicodeChar =3D=3D L'W' - L'A' + 1)) {
= > break;
> }
> }
> --=
> 2.21.1 (Apple Git-122.3)
>
>
> -=3D-=3D-=3D-=3D-=3D-=3D
> 
Groups.io Links: You receive all messages sent to this g= roup.
>
> View/Reply Online (#54122): 
https://edk2.groups.i= o/g/devel/message/54122
> Mute This Topi= c: https://groups.io/mt/7= 1133729/1768756
> Group Owner: devel+owner@edk2.groups.io<= /span>
> Unsubscribe: https://edk2.groups.io/g/devel/unsub
 [zhichao.gao@intel.com]=
> -=3D-=3D-=3D-=3D-=3D-=3D

 =
<= /div>
--Apple-Mail=_C62CAB12-EDE8-4576-93A6-68EDCB77F97C-- -----------------------472ec824a05c8569dead40592a614b75 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: ProtonMail wsBmBAEBCAAQBQJeoHcUCRBPsoxt7Hy0xQAKCRBPsoxt7Hy0xfAtCACQ3X2s K59mF6YMmFhO5/fO+HDrpTPIq8wotsuX+ow04ekjxT5bGdqHY5NLCgrsBpa1 7yyeoDUXRX1mScs7KC0CVq0TXirTs1S7clMp57JrpeROJI+3yTp3hqZ4AE6C 8kVkp/3ww2pEwEkt1TZK5Al/3NeuwFhxVnL2oI4ihKXOriJz9hVlTz8ivuqv IZFte0HbIBlCOlAfxG0a1iitX29K3qB2zJ1ft/uEnliRLBf81wIjt66GwuRE 7Q0rC0F8IWpwxyMWjltmjqNY5D2jS61m4S9oV8G+5Mng5i7uRR9NvEezUrwH 4GqMaA5bkEuZalND4QY6Kb17CSuhe2KQg4V0 =Q0h+ -----END PGP SIGNATURE----- -----------------------472ec824a05c8569dead40592a614b75--