From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c06::22e; helo=mail-io0-x22e.google.com; envelope-from=heyi.guo@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io0-x22e.google.com (mail-io0-x22e.google.com [IPv6:2607:f8b0:4001:c06::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D193720355233 for ; Wed, 8 Nov 2017 00:48:17 -0800 (PST) Received: by mail-io0-x22e.google.com with SMTP id i38so5159144iod.2 for ; Wed, 08 Nov 2017 00:52:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=xasI/9bsJD6rBLEW5JGuBz2rEBjw/fIjOLgwA2eJwe0=; b=JEg6qxa/Pw/Q1f6ClMIgOVVUsSXGtszB3XuhRLY1BLg6YUzvHffATnLB7117SkYrsS nbryNyDymLUMzkUNgsR90gLISo27DmqnTm2bzafsETkhBOfmMdNljcwRE3a+kHYf4DGo rONtDR7MYROVOMIp3VlehzRZWo3uGZgfzyW7k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=xasI/9bsJD6rBLEW5JGuBz2rEBjw/fIjOLgwA2eJwe0=; b=ht+fNZLf2V7jiOwy86t0us4PTKLjSxTeGdNAFBtrwsj/4q2irThjVnOXyeQ45KQlzx HokOiZv1rRCwYN1VcNPJ2xpb9UIwvgwaEEH5/sGtVjUqhPnzM4dhFyNJcFQ2RT/xQQvd ZiteDxMNrM6aGuBJC9WexamFAmIVlMyqSOCI0ke2//TtoHF0lnly+qYUEPF0qwWyii6V 1IN1iadoRTUVVxs9AMW/Odrug7WAIiAHJbgh770VHa2kS0rlwWdldtyT5JoW1HWjSPe8 WgV6gdk0eyo1/e8cHC5Px+y5MgDSCt2oVxapVYUEPUjPBedGc2erIF+2XHy5NPsCyRUi RVig== X-Gm-Message-State: AJaThX5BwlND7LGK8CcylbvPMN45TVtdXndNnwQtwtVCdq1Xywrsbs67 UkoIdiHbmubEhitLi1lKtO3AQw== X-Google-Smtp-Source: ABhQp+TegfyCLyhWeBrEA4+E5ty+aEvn+uMWuFnxmng40sfvZRQzv5XIXpvY4TdXp9szjwLg7tNmNQ== X-Received: by 10.107.9.27 with SMTP id j27mr2109893ioi.111.1510131137527; Wed, 08 Nov 2017 00:52:17 -0800 (PST) Received: from [10.189.19.158] ([45.56.152.90]) by smtp.gmail.com with ESMTPSA id a72sm1935215itb.34.2017.11.08.00.52.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Nov 2017 00:52:16 -0800 (PST) To: "Ni, Ruiyu" , "Zeng, Star" , "edk2-devel@lists.01.org" Cc: "Dong, Eric" References: <1958e840-f0fe-6d8e-44d1-03ff9c9dde7b@linaro.org> <0C09AFA07DD0434D9E2A0C6AEB0483103B9B3162@shsmsx102.ccr.corp.intel.com> <734D49CCEBEEF84792F5B80ED585239D5BAB6CB0@SHSMSX104.ccr.corp.intel.com> <734D49CCEBEEF84792F5B80ED585239D5BAB6F41@SHSMSX104.ccr.corp.intel.com> <734D49CCEBEEF84792F5B80ED585239D5BAB6F90@SHSMSX104.ccr.corp.intel.com> From: Heyi Guo Message-ID: <8454cda4-dc5e-31cf-9d54-5a565c0d8f14@linaro.org> Date: Wed, 8 Nov 2017 16:51:45 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5BAB6F90@SHSMSX104.ccr.corp.intel.com> Subject: Re: [MdeModulePkg/TerminalDxe] Why do we delay 2s for ESC being pressed? X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 08:48:18 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US That makes sense. Thanks very much for your explanation. Regards, Heyi 在 11/8/2017 4:46 PM, Ni, Ruiyu 写道: > Yes. 2 seconds is for some other terminal tools, that cannot do the F10 translation. > > Thanks/Ray > >> -----Original Message----- >> From: Heyi Guo [mailto:heyi.guo@linaro.org] >> Sent: Wednesday, November 8, 2017 4:45 PM >> To: Ni, Ruiyu ; Zeng, Star ; edk2- >> devel@lists.01.org >> Cc: Dong, Eric >> Subject: Re: [MdeModulePkg/TerminalDxe] Why do we delay 2s for ESC >> being pressed? >> >> >> >> 在 11/8/2017 4:34 PM, Ni, Ruiyu 写道: >>> No. >>> Even a terminal tool can recognize F10, it still needs to translate it into "ESC >> [ V" >>> and send the three bytes to firmware. >> Got it. But the 2 seconds timeout is not for this situation, right? If terminal >> tool could translate and send the key sequence, I think it can complete 3 >> bytes transfer in a very short time, isn't it? E.g. 9600 baud / 8 = 1200 Bytes/s >> (ignore control bits). >> >> So 2 seconds timeout is still for user to enter the sequence "ESC [ V" >> manually? >> >> Thanks, >> >> Heyi >> >>> Thanks/Ray >>> >>>> -----Original Message----- >>>> From: Heyi Guo [mailto:heyi.guo@linaro.org] >>>> Sent: Wednesday, November 8, 2017 4:31 PM >>>> To: Ni, Ruiyu ; Zeng, Star ; >>>> edk2- devel@lists.01.org >>>> Cc: Dong, Eric >>>> Subject: Re: [MdeModulePkg/TerminalDxe] Why do we delay 2s for ESC >>>> being pressed? >>>> >>>> >>>> >>>> 在 11/8/2017 3:55 PM, Ni, Ruiyu 写道: >>>>> Heyi, >>>>> >>>>> If you check the comments below in TerminalConIn.c: >>>>> >> https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Universal >>>> /C >>>>> onsole/TerminalDxe/TerminalConIn.c#L1319 >>>>> >>>>> TerminalDxe driver needs to determine whether user wants to press >>>>> ESC alone, or press "ESC [ V" for F10 (PCANSI terminal). >>>> Do you mean F10 is not directly supported on some terminal tools so >>>> that we need to press 3 keys "ESC [ V" quickly and continuously to >> emulate F10? >>>> Thanks, >>>> >>>> Heyi >>>>> So a 2 second timeout is added to wait additional keys. >>>>> >>>>> Thanks/Ray >>>>> >>>>>> -----Original Message----- >>>>>> From: Zeng, Star >>>>>> Sent: Wednesday, November 8, 2017 3:25 PM >>>>>> To: Heyi Guo ; edk2-devel@lists.01.org >>>>>> Cc: Ni, Ruiyu ; Dong, Eric >>>>>> ; Zeng, Star >>>>>> Subject: RE: [MdeModulePkg/TerminalDxe] Why do we delay 2s for >> ESC >>>>>> being pressed? >>>>>> >>>>>> Cc Terminal expert Ray to see if any comments on this. >>>>>> >>>>>> >>>>>> Thanks, >>>>>> Star >>>>>> -----Original Message----- >>>>>> From: Heyi Guo [mailto:heyi.guo@linaro.org] >>>>>> Sent: Wednesday, November 8, 2017 3:04 PM >>>>>> To: edk2-devel@lists.01.org >>>>>> Cc: Zeng, Star ; Dong, Eric >>>>>> >>>>>> Subject: [MdeModulePkg/TerminalDxe] Why do we delay 2s for ESC >>>> being >>>>>> pressed? >>>>>> >>>>>> Hi folks, >>>>>> >>>>>> We found ESC key responded fairly slow on serial port terminal, and >>>>>> we think it might be caused by the code in UnicodeToEfiKey in >>>> TerminalConIn.c: >>>>>>     if (UnicodeChar == ESC) { >>>>>>       TerminalDevice->InputState = INPUT_STATE_ESC; >>>>>>     } >>>>>> >>>>>>     if (UnicodeChar == CSI) { >>>>>>       TerminalDevice->InputState = INPUT_STATE_CSI; >>>>>>     } >>>>>> >>>>>>     if (TerminalDevice->InputState != INPUT_STATE_DEFAULT) { >>>>>>       Status = gBS->SetTimer( >>>>>>                       TerminalDevice->TwoSecondTimeOut, >>>>>>                       TimerRelative, >>>>>>                       (UINT64)20000000 >>>>>>                       ); >>>>>>       ASSERT_EFI_ERROR (Status); >>>>>>       continue; >>>>>>     } >>>>>> >>>>>> It seems we intentionally add 2 seconds delay for ESC key press. >>>>>> This provides not so good user experience when we press ESC to exit >>>>>> or cancel some operation. >>>>>> >>>>>> We tried reducing this timeout value to 1 second, then the >>>>>> experience improved much and we didn't find any issue introduced. >>>>>> >>>>>> What's the reason for this timeout value and is there any improvement? >>>>>> >>>>>> Thanks and regards, >>>>>> >>>>>> Heyi