From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: liming.gao@intel.com) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by groups.io with SMTP; Wed, 25 Sep 2019 06:32:32 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Sep 2019 06:32:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,548,1559545200"; d="scan'208";a="364324759" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga005.jf.intel.com with ESMTP; 25 Sep 2019 06:32:32 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 25 Sep 2019 06:32:31 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 25 Sep 2019 06:32:31 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.32]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.140]) with mapi id 14.03.0439.000; Wed, 25 Sep 2019 21:32:29 +0800 From: "Liming Gao" To: "devel@edk2.groups.io" , "Gao, Zhichao" Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/TerminalDxe: Enhance the arrow keys support Thread-Topic: [edk2-devel] [PATCH] MdeModulePkg/TerminalDxe: Enhance the arrow keys support Thread-Index: AQHVc5rGDBPEPczzUUKnQSOdaNuR+Kc8ZA4g Date: Wed, 25 Sep 2019 13:32:29 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E50173C@SHSMSX104.ccr.corp.intel.com> References: <20190925120925.12600-1-zhichao.gao@intel.com> In-Reply-To: <20190925120925.12600-1-zhichao.gao@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiM2FmYmI2MmUtZDliNC00ODcxLWE0YTQtY2I3MDYyMjMyNTBhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiTHN5OHJhektUTkVIRUt1R1V0b2oxWjhBa1g2dGIxVkpxTHd3NFwvd1MycWVSdGdyTFlaRURWN3RnVVNWTGtsTmgifQ== dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: liming.gao@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks for your quick fix.=20 > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Gao, Zhic= hao > Sent: Wednesday, September 25, 2019 8:09 PM > To: devel@edk2.groups.io > Cc: Wang, Jian J ; Wu, Hao A = ; Ni, Ray ; Gao, Liming > > Subject: [edk2-devel] [PATCH] MdeModulePkg/TerminalDxe: Enhance the arro= w keys support >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2219 >=20 > Refer to > https://www.ssh.com/ssh/putty/putty-manuals/0.68/Chapter4.html#config-ap= pcursor > In normal mode, arrow key would send ESC [A through to ESC [D. > In application mode, arrow key would send ESC OA through to > ESC OD. >=20 > Cc: Jian J Wang > Cc: Hao A Wu > Cc: Ray Ni > Cc: Liming Gao > Signed-off-by: Zhichao Gao > --- > .../Console/TerminalDxe/TerminalConIn.c | 46 ++++++++++++++++--- > 1 file changed, 40 insertions(+), 6 deletions(-) >=20 > diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c > b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c > index ac31f27984..fdb1a0f1ef 100644 > --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c > +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c > @@ -1402,10 +1402,7 @@ UnicodeToEfiKey ( > continue; > } >=20 > - if (UnicodeChar =3D=3D 'O' && (TerminalDevice->TerminalType =3D= =3D TerminalTypeVt100 || > - TerminalDevice->TerminalType =3D=3D Te= rminalTypeTtyTerm || > - TerminalDevice->TerminalType =3D=3D Te= rminalTypeXtermR6 || > - TerminalDevice->TerminalType =3D=3D Te= rminalTypeVt100Plus)) { > + if (UnicodeChar =3D=3D 'O') { > TerminalDevice->InputState |=3D INPUT_STATE_O; > TerminalDevice->ResetState =3D RESET_STATE_DEFAULT; > continue; > @@ -1631,6 +1628,35 @@ UnicodeToEfiKey ( > } > } >=20 > + // > + // In Putty application mode, the arrow keys would send > + // ESC OA through to ESC OD > + // > + if (TerminalDevice->TerminalType =3D=3D TerminalTypePcAnsi || > + TerminalDevice->TerminalType =3D=3D TerminalTypeVt100 || > + TerminalDevice->TerminalType =3D=3D TerminalTypeVt100Plus || > + TerminalDevice->TerminalType =3D=3D TerminalTypeVtUtf8 || > + TerminalDevice->TerminalType =3D=3D TerminalTypeTtyTerm || > + TerminalDevice->TerminalType =3D=3D TerminalTypeLinux || > + TerminalDevice->TerminalType =3D=3D TerminalTypeXtermR6 || > + TerminalDevice->TerminalType =3D=3D TerminalTypeVt400 || > + TerminalDevice->TerminalType =3D=3D TerminalTypeSCO) { > + switch (UnicodeChar) { > + case 'A': > + Key.ScanCode =3D SCAN_UP; > + break; > + case 'B': > + Key.ScanCode =3D SCAN_DOWN; > + break; > + case 'C': > + Key.ScanCode =3D SCAN_RIGHT; > + break; > + case 'D': > + Key.ScanCode =3D SCAN_LEFT; > + break; > + } > + } > + > if (Key.ScanCode !=3D SCAN_NULL) { > Key.UnicodeChar =3D 0; > EfiKeyFiFoInsertOneKey (TerminalDevice, &Key); > @@ -1668,10 +1694,18 @@ UnicodeToEfiKey ( >=20 > Key.ScanCode =3D SCAN_NULL; >=20 > + // > + // In Putty normal mode, the arrow keys would send > + // ESC [A through to [D > + // > if (TerminalDevice->TerminalType =3D=3D TerminalTypePcAnsi || > TerminalDevice->TerminalType =3D=3D TerminalTypeVt100 || > - TerminalDevice->TerminalType =3D=3D TerminalTypeVtUtf8 || > - TerminalDevice->TerminalType =3D=3D TerminalTypeTtyTerm || > + TerminalDevice->TerminalType =3D=3D TerminalTypeVt100Plus || > + TerminalDevice->TerminalType =3D=3D TerminalTypeVtUtf8 || > + TerminalDevice->TerminalType =3D=3D TerminalTypeTtyTerm || > + TerminalDevice->TerminalType =3D=3D TerminalTypeLinux || > + TerminalDevice->TerminalType =3D=3D TerminalTypeXtermR6 || > + TerminalDevice->TerminalType =3D=3D TerminalTypeVt400 || > TerminalDevice->TerminalType =3D=3D TerminalTypeSCO) { > switch (UnicodeChar) { > case 'A': > -- > 2.21.0.windows.1 >=20 >=20 >=20