public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ni, Ruiyu" <ruiyu.ni@intel.com>
To: Heyi Guo <heyi.guo@linaro.org>,
	"Zeng, Star" <star.zeng@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Dong, Eric" <eric.dong@intel.com>
Subject: Re: [MdeModulePkg/TerminalDxe] Why do we delay 2s for ESC being pressed?
Date: Wed, 8 Nov 2017 08:46:30 +0000	[thread overview]
Message-ID: <734D49CCEBEEF84792F5B80ED585239D5BAB6F90@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <bc970b4b-7e3b-0590-b151-3a5b1d2aa748@linaro.org>

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 <ruiyu.ni@intel.com>; Zeng, Star <star.zeng@intel.com>; edk2-
> devel@lists.01.org
> Cc: Dong, Eric <eric.dong@intel.com>
> 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 <ruiyu.ni@intel.com>; Zeng, Star <star.zeng@intel.com>;
> >> edk2- devel@lists.01.org
> >> Cc: Dong, Eric <eric.dong@intel.com>
> >> 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 <heyi.guo@linaro.org>; edk2-devel@lists.01.org
> >>>> Cc: Ni, Ruiyu <ruiyu.ni@intel.com>; Dong, Eric
> >>>> <eric.dong@intel.com>; Zeng, Star <star.zeng@intel.com>
> >>>> 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 <star.zeng@intel.com>; Dong, Eric
> >>>> <eric.dong@intel.com>
> >>>> 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


  reply	other threads:[~2017-11-08  8:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-08  7:04 [MdeModulePkg/TerminalDxe] Why do we delay 2s for ESC being pressed? Heyi Guo
2017-11-08  7:24 ` Zeng, Star
2017-11-08  7:55   ` Ni, Ruiyu
2017-11-08  8:30     ` Heyi Guo
2017-11-08  8:34       ` Ni, Ruiyu
2017-11-08  8:44         ` Heyi Guo
2017-11-08  8:46           ` Ni, Ruiyu [this message]
2017-11-08  8:51             ` Heyi Guo
2017-11-08  9:07           ` Gerd Hoffmann
2017-11-08 13:34             ` Heyi Guo
2017-11-08 16:00               ` Brian J. Johnson
2017-11-24  7:21                 ` Heyi Guo
2017-11-28 17:55                   ` Brian J. Johnson
2017-11-29  4:18                     ` Andrew Fish

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=734D49CCEBEEF84792F5B80ED585239D5BAB6F90@SHSMSX104.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox