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:c0b::242; helo=mail-it0-x242.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (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 6B129210ED76D for ; Fri, 24 Aug 2018 07:46:22 -0700 (PDT) Received: by mail-it0-x242.google.com with SMTP id j81-v6so2435115ite.0 for ; Fri, 24 Aug 2018 07:46:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=dbfOSrmanuQbnavBKK8vwswqz2hUKnb/rjmkOhXz28Q=; b=EiFXg9GmrbBoXcDqhzRtXY1/THS/In/77VSPvx/M2YXBiyHWLroDMVsMqFe9AwdkkI WqYyEBMrBHnvTdhkaBCA7ofsiRiWzL3RGYemdkIMw5AxYb8fqodyDrknWZmvizDFEk+p hX+V4QIxAtmgvkxGkLT0rIBBcnYXqVo+4Ro/s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=dbfOSrmanuQbnavBKK8vwswqz2hUKnb/rjmkOhXz28Q=; b=pzNnTcJYAlj4fpoFp+RXWADsPfifBtO1/rXeV7XjUV/KCQRZKdmhnQuht7WcABnXBk bidsjj4n+7D0eyE/YhXd+jUbFnq9pfb/5BmrETMra443IQiq3qwtqu8J0BLxPsEvtk5t 7UG1HploGH8ikBybSIrebNF9z74PFURcLitRP27zUhJxB3VkFdFobBYXOrKjpr6t52Yy C998yzn1iyiniftwjU3ljG0QO3vRCNfixtYqX0A3JYJMu6x80J+zwBPuBpMSzMY06J4+ m/xuwF6XCIphtRyNz0MZFdoTI9o6u4OtNnv6uETUwt01zNzPOaE+y6iamFT/Ng8p+5ju Dcrw== X-Gm-Message-State: APzg51CEZIyn35rYC1xvDQuoeU8gGEtBn5aMmOEXHTohiZIuOfveIQRy +1jIyxz6MGdsDrnGcS2suK6/J2RkkEQ73mlryuURHQ== X-Google-Smtp-Source: ANB0VdbvYy1/O2gDCoZxk7H1T0NbhEQBVzWTlpDccuva9LQURmYLJfZzjGMVzOD9qnipFkenF4v+Qqpjf2yElRoP3mM= X-Received: by 2002:a02:4d1b:: with SMTP id l27-v6mr1528117jab.86.1535121981628; Fri, 24 Aug 2018 07:46:21 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:ac05:0:0:0:0:0 with HTTP; Fri, 24 Aug 2018 07:46:21 -0700 (PDT) In-Reply-To: <1535004873-24208-1-git-send-email-haojian.zhuang@linaro.org> References: <1535004873-24208-1-git-send-email-haojian.zhuang@linaro.org> From: Ard Biesheuvel Date: Fri, 24 Aug 2018 15:46:21 +0100 Message-ID: To: Haojian Zhuang Cc: "edk2-devel@lists.01.org" , Leif Lindholm Subject: Re: [PATCH v1 1/1] EmbeddedPkg/AndroidFastbootApp: only use ENTER or SPACE to exit X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Aug 2018 14:46:22 -0000 Content-Type: text/plain; charset="UTF-8" On 23 August 2018 at 07:14, Haojian Zhuang 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 > Cc: Ard Biesheuvel > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Haojian Zhuang Reviewed-by: Ard Biesheuvel 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 >