From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Haojian Zhuang <haojian.zhuang@linaro.org>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
Leif Lindholm <leif.lindholm@linaro.org>
Subject: Re: [PATCH v1 1/1] EmbeddedPkg/AndroidFastbootApp: only use ENTER or SPACE to exit
Date: Fri, 24 Aug 2018 15:46:21 +0100 [thread overview]
Message-ID: <CAKv+Gu-zjPSXhi7rFuvsePtisg1qYfWwqEHYeiL516WQyWTTnQ@mail.gmail.com> (raw)
In-Reply-To: <1535004873-24208-1-git-send-email-haojian.zhuang@linaro.org>
On 23 August 2018 at 07:14, Haojian Zhuang <haojian.zhuang@linaro.org> wrote:
> Since hotkey 'f' is used to start AndroidFastbootApp. If user
> press 'f' key too long, it may be recognized pressing 'f' key
> multiple times. Then AndroidFastbootApp exists since it delcares
> any key press could make it exit.
>
> So only use ENTER or SPACE key to exit AndroidFastbootApp.
>
> Cc: Leif Lindholm <leif.lindholm@linaro.org>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Pushed as 6861765935d5b69803321ba6e43240845c7ab0e5
Thanks
> ---
> EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.c | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.c b/EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.c
> index c5e8a7e34af2..c1ed94f92b6f 100644
> --- a/EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.c
> +++ b/EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.c
> @@ -426,6 +426,7 @@ FastbootAppEntryPoint (
> EFI_EVENT WaitEventArray[2];
> UINTN EventIndex;
> EFI_SIMPLE_TEXT_INPUT_PROTOCOL *TextIn;
> + EFI_INPUT_KEY Key;
>
> mDataBuffer = NULL;
>
> @@ -508,12 +509,21 @@ FastbootAppEntryPoint (
>
> // Talk to the user
> mTextOut->OutputString (mTextOut,
> - L"Android Fastboot mode - version " ANDROID_FASTBOOT_VERSION ". Press any key to quit.\r\n");
> + L"Android Fastboot mode - version " ANDROID_FASTBOOT_VERSION ". Press RETURN or SPACE key to quit.\r\n");
>
> // Quit when the user presses any key, or mFinishedEvent is signalled
> WaitEventArray[0] = mFinishedEvent;
> WaitEventArray[1] = TextIn->WaitForKey;
> - gBS->WaitForEvent (2, WaitEventArray, &EventIndex);
> + while (1) {
> + gBS->WaitForEvent (2, WaitEventArray, &EventIndex);
> + Status = TextIn->ReadKeyStroke (gST->ConIn, &Key);
> + if (Key.ScanCode == SCAN_NULL) {
> + if ((Key.UnicodeChar == CHAR_CARRIAGE_RETURN) ||
> + (Key.UnicodeChar == L' ')) {
> + break;
> + }
> + }
> + }
>
> mTransport->Stop ();
> if (EFI_ERROR (Status)) {
> --
> 2.7.4
>
prev parent reply other threads:[~2018-08-24 14:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-23 6:14 [PATCH v1 1/1] EmbeddedPkg/AndroidFastbootApp: only use ENTER or SPACE to exit Haojian Zhuang
2018-08-24 14:46 ` Ard Biesheuvel [this message]
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=CAKv+Gu-zjPSXhi7rFuvsePtisg1qYfWwqEHYeiL516WQyWTTnQ@mail.gmail.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