From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-40134.protonmail.ch (mail-40134.protonmail.ch [185.70.40.134]) by mx.groups.io with SMTP id smtpd.web10.1032.1587147270641966785 for ; Fri, 17 Apr 2020 11:14:31 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@protonmail.com header.s=default header.b=czq2znuQ; spf=pass (domain: protonmail.com, ip: 185.70.40.134, mailfrom: vit9696@protonmail.com) Date: Fri, 17 Apr 2020 18:14:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=default; t=1587147259; bh=gaueBe5B3QsPdkjTYROEG6od+upCRpFb1kNTQTVHeww=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=czq2znuQmIKvWNzlOe1Fu9WzPwplzYlz4A5xeIgHpRre8rB1drQT5SPPPuaQ+gMzn 129i1x81TKlttQc418fdwfBsFjnEPWOSRxZzlUidFJOo1EQp9W+vLqoAlErPKjrtDN lANl2t9W9f6LjzyQ+f8+55IBNh6UVKnfZLbnHG5g= 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: 57544 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha256; boundary="---------------------f68345c52589a60b2b159e48b7033e56"; charset=UTF-8 -----------------------f68345c52589a60b2b159e48b7033e56 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=_73AF2444-D1FE-4BF3-A3C7-89FFD5DFF741" Date: Fri, 17 Apr 2020 21:14:05 +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=_73AF2444-D1FE-4BF3-A3C7-89FFD5DFF741 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Zhichao, This is correct. I did not notice the message previously, but otherwise ev= erything outlined here is accurate. Let me know if further input can be per= formed 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 =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0=B0): >=20 > 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 > <>=20 > 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=_73AF2444-D1FE-4BF3-A3C7-89FFD5DFF741 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Zhichao,
<= br class=3D"">
This is correct. I did not notice the m= essage previously, but otherwise everything outlined here is accurate. Let = me know if further 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@intel.com> =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0= = =D0=BB(=D0=B0):

=
Summ= arize the issue, if anything incorrect, please help to correct it. Thanks.<= o:p class=3D"">
 
Backgrou= nd:
Uefi spec ambiguous description:
> When interpretin= g the data from this function, it should be noted that if a class
> of printable char= acters that are normally adjusted by shift modifiers (e.g. Shift
> Key + "f" key) wo= uld 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.UnicodeChar with
> the value of "F". Thi= s of course would not typically be the case for non-printable
> characters such as th= e pressing of the Right Shift Key + F10 key since the=
> corresponding returned data wo= uld be reflected both in the
> KeyData.KeyState.KeyShiftState and KeyData.Key.ScanC= ode values.=
 
Some firmware vendor see the =E2=80= =9Cif=E2=80=9D as an option to implement the keyboard driver and they choo= se to implement in the other way.
Ideal: shif= t + UnicodeKey/UnScancodeKey =3D=3D report as =3D=3D> =E2=80=9Cshifted= =E2=80=9D UnicodeKey/UnScancodeKey
 &nb= sp;            =   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
         &nb= sp;      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 cause the shell edit/Hexedit missi= ng handling the =E2=80=9Cshifted=E2=80=9D key when run shell in such firmwa= re.
 
Vit= aly=E2=80=99s solution add the support the handle =E2=80=9Cother implementa= tion=E2=80=9D.
 
If we take Vitaly=E2=80=99s solution, we should fixed all the applic= ations 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.
&n= bsp;
Thanks,
Zhichao
 
From: devel@edk2.groups.io = [mailto:devel@edk2.groups.io] On Behalf Of Gao, Zhichao
Sent: Thursday, April 2, 2020 2:57 PM
To: d= evel@edk2.groups.io; = vit9696@protonmail.com; Rothman, Michael= A <michael.a.rothman@intel.com&= gt;
Cc: Andrew Fish <afish@apple.com&= gt;; Laszlo Ersek <lersek@redhat.com>; = Marvin H=C3=A4user <mhaeuser@outlook.de&= gt;; Kinney, Michael D <michael.d.kin= ney@intel.com>; Ni, Ray <ray.ni@intel.co= m>
Subject: Re: [edk2-devel] [PATCH 1/1] ShellPkg: Add suppor= t for input with 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.
<= span style=3D"font-size: 11pt; font-family: Calibri, sans-serif; color: rgb= (31, 73, 125);" class=3D"">Should the edk2 code to handle such issue? If ye= s, here maybe the situation:
1.       Change= for all apps -> uefi spec update and accept  such behavior with de= scription -> Done.
2.&nb= sp;     &nbs= p;Change for all ap= ps -> uefi spec update to remove the ambiguous and reject other behavior= -> removal the change in first step.
=
 
Hi Vitaly,<= /div>
 
I used to think it is an additional s= upport for different implementation because of the spec. But if we approve = this patch, all the app in edk2 using the combo key function should be upda= te.
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 to= ol.
 
Tha= nks,
Zhichao
 
Fr= om: = devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Vitaly Cheptsov via Groups.Io
Sent: Friday, March 27, 2020 7:01 PM
To: Gao, Zhichao <
zhichao.gao@intel.com>
Cc: devel@edk2.groups.io<= span style=3D"font-size: 11pt; font-family: Calibri, sans-serif;" class=3D"= ">; Andrew Fish <
afish@apple.com>; Laszlo Ersek <lersek@= redhat.com>; Marvin H=C3=A4user <mhaeuser@outlook.de>; Kinney, Michael D &l= t;michael.d.kinney@intel.com>; Ni, Ray <ray.ni@= intel.com>
Subject: Re: [edk2-devel] [PATCH 1/1] Sh= ellPkg: Add support for input with separately reported modifiers
 
Hello,
 
Requesting to merge this= into edk2-stable202005 for the reasons explained in BZ[1]. I assume t= here is no real objection for this, only the approach we make such changes = in the future, but this can be postponed as we encounter more of such probl= ems.
 
Best regards,=
Vitaly
 

 

20 =D1=84=D0=B5=D0=B2=D1= =80. 2020 =D0=B3., =D0=B2 03:27, Gao, Zhichao <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 comments for this patch.
= Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
 
Thanks,
Zhi= chao
 
<= div class=3D"">
From: vit9696 <vit9696@protonmail.com> 
Sent: Wednesday, Fe= bruary 19, 2020 8:15 PM
To: Gao, Zhichao <zhichao.gao@intel.com>; dev= el@edk2.groups.io
Subject: 
RE: [edk2-devel] [PATCH 1/1= ] ShellPkg: Add support for input with separately reported modifiers
 
<= /div>
Zhichao,
 =
Thanks for your review= . The comment is correct, as ShiftOnlyState means the state where only shif= t (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<= /a>> wrote:

Hi Vitaly,

See the= comment below:

> -----Original Message----= -
> From: devel@edk2.groups.i= o <
devel@edk2.group= s.io> On Behalf Of Vitaly
> Cheptsov via = Groups.Io
> Sent: Monday, February 10, 2020 6:18 PM
> To: 
<= a href=3D"mailto:devel@edk2.groups.io" style=3D"color: purple; text-decorat= ion: underline;" class=3D"">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 unicod= e letter.
> - Report Ctrl modifier with "shifted" UniChar = (i.e. X - 'A' + 1).
>
> This change provi= des support for these firmwares preserving the compatibility
= > with the previous input handling.
>
>= ; Signed-off-by: Michael Belyaev <
usrsse2@icloud.com>
> Revie= wed-by: Vitaly Cheptsov <
vit9696@protonmail.com>
> ---> ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextE= ditor.c | 37
> ++++++++++++++------
> She= llPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.c | 28
= > ++++++++++-----
> ShellPkg/Library/UefiShellDebug1Com= mandsLib/EditMenuBar.c | 6 ++++
> ShellPkg/Library/UefiShe= llDebug1CommandsLib/HexEdit/MainHexEditor.c | 11
> +++---<= br class=3D"">> 4 files changed, 58 insertions(+), 24 deletions(-)
>
> diff --git
> a/ShellPkg/L= ibrary/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c
> = b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c
> index df530f1119..9615a4dfbd 100644
> --- a/Sh= ellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c
> +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEdit= or.c
> @@ -1381,8 +1381,8 @@ MainCommandDisplayHelp (
> continue;
> }
>
> - if (((KeyData.KeyState.KeyShiftState & EFI_SHIFT_STATE_VA= LID) =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 (((K= eyData.KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) !=3D 0)
> &&
> - ((KeyData.KeyState.KeyShiftStat= e & (EFI_LEFT_CONTROL_PRESSED |
> EFI_RIGHT_CONTROL_PR= ESSED)) !=3D 0) &&
> - ((KeyData.KeyState.KeyShift= State & ~(EFI_SHIFT_STATE_VALID |
> EFI_LEFT_CONTROL_P= RESSED | EFI_RIGHT_CONTROL_PRESSED)) =3D=3D 0)) {
> + } el= se if (((KeyData.KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) !=3D 0= )
> + && ((KeyData.KeyState.KeyShiftState & (E= FI_LEFT_CONTROL_PRESSED |
> EFI_RIGHT_CONTROL_PRESSED)) != =3D 0)
> + && ((KeyData.KeyState.KeyShiftState &a= mp;
> + ~(EFI_SHIFT_STATE_VALID | EFI_LEFT_CONTROL_PRESSED= |
> + EFI_RIGHT_CONTROL_PRESSED)) =3D=3D 0)) {
> //
> // For consoles that supports/reports shi= ft state,
> // make sure that only CONTROL shift key is pr= essed.
> + // 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.Uni= codeChar =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 @@ MainEditorKeyInp= ut (
> EFI_KEY_DATA KeyData;
> EFI_STATUS= Status;
> EFI_SIMPLE_POINTER_STATE MouseState;
> - BOOLEAN NoShiftState;
> + BOOLEAN NoModifier= State;
> + BOOLEAN ShiftOnlyState;
>
> do {
>
> @@ -1886,17 +1890= ,28 @@ MainEditorKeyInput (
> //
> Status= BarSetRefresh();
> //
> - // NoShiftState= : TRUE when no shift key is pressed.
> + // NoModifierStat= e: TRUE when no modifier key is pressed.
> //
> - NoShiftState =3D ((KeyData.KeyState.KeyShiftState &
> EFI_SHIFT_STATE_VALID) =3D=3D 0) || (KeyData.KeyState.KeyShiftS= tate =3D=3D
> EFI_SHIFT_STATE_VALID);
> += NoModifierState =3D ((KeyData.KeyState.KeyShiftState &
&= gt; EFI_SHIFT_STATE_VALID) =3D=3D 0)
> + || (KeyData.KeySt= ate.KeyShiftState =3D=3D EFI_SHIFT_STATE_VALID);
> + //> + // ShiftOnlyState: TRUE when no modifier key except Shif= t is pressed.
> + //
> + ShiftOnlyState = =3D ((KeyData.KeyState.KeyShiftState &
> EFI_SHIFT_ST= ATE_VALID) =3D=3D 0)
> + || ((KeyData.KeyState.KeyShiftSta= te
> + & ~(EFI_SHIFT_STATE_VALID |
> = + EFI_LEFT_SHIFT_PRESSED | EFI_RIGHT_SHIFT_PRESSED)) =3D=3D 0);
> //
> // dispatch to different components' key hand= ling function
> //
> if (EFI_NOT_FOUND != =3D MenuBarDispatchControlHotKey(&KeyData)) {
> Statu= s =3D EFI_SUCCESS;
> - } else if (NoShiftState && = ((KeyData.Key.ScanCode =3D=3D SCAN_NULL) ||
> ((KeyData.Ke= y.ScanCode >=3D SCAN_UP) && (KeyData.Key.ScanCode <=3D
> SCAN_PAGE_DOWN)))) {
> + } else if ((ShiftOnl= yState && (KeyData.Key.ScanCode =3D=3D SCAN_NULL))
&g= t; + || (NoModifierState && (KeyData.Key.ScanCode >=3D SCAN_UP) = &&
> (KeyData.Key.ScanCode <=3D SCAN_PAGE_DOWN)= )) {
> + //
> + // alphanumeric keys with= or without shift, or arrow keys without shift
> + //

This is unmatched with the comments. It only handl= es the alphanumeric keys with shift.

Thanks,Zhichao

> Status =3D FileBuffe= rHandleInput (&KeyData.Key);
> - } else if (NoShiftSta= te && (KeyData.Key.ScanCode >=3D SCAN_F1) &&
> (KeyData.Key.ScanCode <=3D SCAN_F12)) {
> + } e= lse 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/UefiSh= ellDebug1CommandsLib/EditInputBar.c
> b/ShellPkg/Library/U= efiShellDebug1CommandsLib/EditInputBar.c
> index 35b0b701e= 8..d053059220 100644
> --- a/ShellPkg/Library/UefiShellDeb= ug1CommandsLib/EditInputBar.c
> +++ b/ShellPkg/Library/Uef= iShellDebug1CommandsLib/EditInputBar.c
> @@ -130,6 +130,8 = @@ InputBarRefresh (
> UINTN EventIndex;
>= ; UINTN CursorRow;
> UINTN CursorCol;
> += BOOLEAN ShiftPressed;
> + BOOLEAN ModifiersPressed;
>
> //
> // variable initiali= zation
> @@ -180,17 +182,23 @@ InputBarRefresh (
> if (EFI_ERROR (Status)) {
> continue;
> }
> - if (((KeyData.KeyState.KeyShiftState &am= p; 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)
> + &am= p;& (KeyData.KeyState.KeyShiftState !=3D
> + EFI_SHIFT= _STATE_VALID);
> +
> + //
&= gt; + // TRUE if Shift is pressed and no other modifiers are pressed
> + //
> + ShiftPressed =3D ModifiersPressed &a= mp;&
> + ((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 (K= eyData.Key.ScanCode =3D=3D SCAN_ESC) {
> + if (!ModifiersP= ressed && KeyData.Key.ScanCode =3D=3D SCAN_ESC) {
>= ; Size =3D 0;
> Status =3D EFI_NOT_READY;
&g= t; 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
> + && (Key= Data.Key.UnicodeChar =3D=3D CHAR_LINEFEED ||
> + KeyData.K= ey.UnicodeChar =3D=3D CHAR_CARRIAGE_RETURN)) {
> break;> - } else if (KeyData.Key.UnicodeChar =3D=3D CHAR_BACKSPACE= ) {
> + } else if (!ModifiersPressed && KeyData.Ke= y.UnicodeChar =3D=3D
> + CHAR_BACKSPACE) {
&= gt; //
> // backspace
> //
= > @@ -213,7 +222,8 @@ InputBarRefresh (
>
> }
> }
> - } else if (KeyData.Key.Un= icodeChar <=3D 127 && KeyData.Key.UnicodeChar >=3D
> 32) {
> + } else if ((!ModifiersPressed || Shi= ftPressed)
> + && KeyData.Key.UnicodeChar <=3D = 127 &&
> + KeyData.Key.UnicodeChar >=3D 32) {> //
> // VALID ASCII char pressed
> //
> diff --git a/ShellPkg/Library/UefiShellDe= bug1CommandsLib/EditMenuBar.c
> b/ShellPkg/Library/UefiShe= llDebug1CommandsLib/EditMenuBar.c
> index ca8bc506d9..eabb= f3c571 100644
> --- a/ShellPkg/Library/UefiShellDebug1Comm= andsLib/EditMenuBar.c
> +++ b/ShellPkg/Library/UefiShellDe= bug1CommandsLib/EditMenuBar.c
> @@ -190,11 +190,17 @@ Menu= BarDispatchControlHotKey (
> //
> // For = consoles that supports/reports shift state,
> // make sure= only CONTROL is pressed.
> + // For some consoles that re= port shift state,
> + // Ctrl+A is still translated to 1 (= UnicodeChar).
> //
> if ((KeyData->Key= .UnicodeChar >=3D L'A') && (KeyData->Key.UnicodeChar <=3D<= br class=3D"">> L'Z')) {
> ControlIndex =3D KeyData->= ;Key.UnicodeChar - L'A' + 1;
> } else if ((KeyData->Key= .UnicodeChar >=3D L'a') && (KeyData->Key.UnicodeChar
> <=3D L'z')) {
> ControlIndex =3D KeyData-&g= t;Key.UnicodeChar - L'a' + 1;
> + } else if ((KeyData->= Key.UnicodeChar >=3D L'A' - L'A' + 1) && (KeyData-
> >Key.UnicodeChar <=3D L'Z' - L'A' + 1)) {
> + = ControlIndex =3D KeyData->Key.UnicodeChar;
> + } else i= f ((KeyData->Key.UnicodeChar >=3D L'a' - L'a' + 1) && (KeyDat= a-
> >Key.UnicodeChar <=3D L'z' - L'z' + 1)) {
> + ControlIndex =3D KeyData->Key.UnicodeChar;
> }
> }
> if ((SCAN_CONTROL_Z < Co= ntrolIndex)
> diff --git
> a/ShellPkg/Lib= rary/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c
> = b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c
> index a00df49d38..394e531c16 100644
> --- a/= ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c
> +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainH= exEditor.
> +++ c
> @@ -137,14 +137,17 @@= HMainCommandDisplayHelp (
> if (KeyData.Key.UnicodeChar = =3D=3D L'W' - L'A' + 1) {
> break;
> }> - } else if (((KeyData.KeyState.KeyShiftState & EFI_S= HIFT_STATE_VALID) !=3D 0)
> &&
> = - ((KeyData.KeyState.KeyShiftState & (EFI_LEFT_CONTROL_PRESSED |
> EFI_RIGHT_CONTROL_PRESSED)) !=3D 0) &&
&= gt; - ((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)
> + && ((Key= Data.KeyState.KeyShiftState & (EFI_LEFT_CONTROL_PRESSED |
> EFI_RIGHT_CONTROL_PRESSED)) !=3D 0)
> + && (= (KeyData.KeyState.KeyShiftState &
> + ~(EFI_SHIFT_STAT= E_VALID | EFI_LEFT_CONTROL_PRESSED |
> + EFI_RIGHT_CONTROL= _PRESSED)) =3D=3D 0)) {
> //
> // For con= soles that supports/reports shift state,
> // make sure th= at only CONTROL shift key is pressed.
> + // For some cons= oles that report shift state,
> + // CTRL+W is still trans= lated to L'W' - L'A' + 1.
> //
> - if ((K= eyData.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) ||
> + (Ke= yData.Key.UnicodeChar =3D=3D L'W' - L'A' + 1)) {
> break;<= br class=3D"">> }
> }
> --
> 2.21.1 (Apple Git-122.3)
>
>
> -=3D-=3D-=3D-=3D-=3D-=3D
> 
Groups.io Links: You re= ceive all messages sent to this group.
>
>= ; View/Reply Online (#54122): https://edk2.groups.io/g/devel/message/54122
> Mute This Topic: https://group= s.io/mt/71133729/1768756
> Group Owner: 
devel+owner@edk2.groups.io
> Unsubscribe: https://= edk2.groups.io/g/devel/unsub [zhic= hao.gao@intel.com]
> -=3D-=3D-=3D-=3D-=3D-= =3D

=
 

--Apple-Mail=_73AF2444-D1FE-4BF3-A3C7-89FFD5DFF741-- -----------------------f68345c52589a60b2b159e48b7033e56 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: ProtonMail wsBmBAEBCAAQBQJemfHvCRBPsoxt7Hy0xQAKCRBPsoxt7Hy0xT+6B/95XRIN KzQCbxWoeO6wq5noKzcpf9LIEaTFgPB+NW3rmxH8AoUeAj9tW4IzE6926w9e Q7d5Yp8opUWRaTQ4JEfXhhG2XG6RzdKl/sW3Zhy/9IjW+zdxumKlAdVl2Um3 esx5QjfcPeqOPpvkCVR+nJnaSpo77ZiBiCga4fMUgJ071UXLVrG2a+HU2sFh KgOadWxOSzU6yYvLVA97a+NqePE6sRL9U+EAaneovIoFE9/SIcsG4s1D/gYo ycongSx1WKaQ+tr3nRGi6eSWOOaVHl6Z+Z0EBulLOKQ6SuFXrrA1qNUENLB3 jtkdUodxM4k53UYgjfVcSeMJwiXt3QhCs9Ct =P84N -----END PGP SIGNATURE----- -----------------------f68345c52589a60b2b159e48b7033e56--