On 12 February 2014 15:09,  <oliviermar...@users.sourceforge.net> wrote:
> Revision: 15236
>           http://sourceforge.net/p/edk2/code/15236
> Author:   oliviermartin
> Date:     2014-02-12 15:09:58 +0000 (Wed, 12 Feb 2014)
> Log Message:
> -----------
> ArmPlatformPkg/BdsLib: Let the user press enter when inputting booleans
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Olivier Martin <olivier.mar...@arm.com>
>
> Modified Paths:
> --------------
>     trunk/edk2/ArmPlatformPkg/Bds/BdsHelper.c
>
> Modified: trunk/edk2/ArmPlatformPkg/Bds/BdsHelper.c
> ===================================================================
> --- trunk/edk2/ArmPlatformPkg/Bds/BdsHelper.c   2014-02-12 11:37:57 UTC (rev 
> 15235)
> +++ trunk/edk2/ArmPlatformPkg/Bds/BdsHelper.c   2014-02-12 15:09:58 UTC (rev 
> 15236)
> @@ -52,7 +52,7 @@
>
>      if ((Char == CHAR_LINEFEED) || (Char == CHAR_CARRIAGE_RETURN) || (Char 
> == 0x7f)) {
>        CmdLine[CmdLineIndex] = '\0';
> -      Print (L"\n\r");
> +      Print (L"\r\n");
>
>        return EFI_SUCCESS;
>      } else if ((Key.UnicodeChar == L'\b') || (Key.ScanCode == SCAN_LEFT) || 
> (Key.ScanCode == SCAN_DELETE)){
> @@ -187,7 +187,9 @@
>
>    while(1) {
>      Print (L"[y/n] ");
> -    Status = GetHIInputStr (CmdBoolean, 2);
> +    // Set MaxCmdLine to 3 to give space for carriage return (when the user
> +    // hits enter) and terminal '\0'.
> +    Status = GetHIInputStr (CmdBoolean, 3);

I'm not convinced this is the correct approach.  The way I fixed this
(in Linaro's tree) is with this patch:

http://git.linaro.org/arm/uefi/uefi-next.git/commitdiff/c030b6cbb503eece468dc1477db814c9a2ff11a2

I think it provides the feedback the way the user would expect it:
- If it's a boolean question, eg, y/n, you can enter only 1 character.
- If you try to enter more characters, nothing happens.
- You can delete your single character and enter a different one.
- The input completes when the user presses enter.



>      if (EFI_ERROR(Status)) {
>        return Status;
>      } else if ((CmdBoolean[0] == L'y') || (CmdBoolean[0] == L'Y')) {
>
> This was sent by the SourceForge.net collaborative development platform, the 
> world's largest Open Source development site.
>
>
> ------------------------------------------------------------------------------
> Android apps run on BlackBerry 10
> Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
> Now with support for Jelly Bean, Bluetooth, Mapview and more.
> Get your Android app in front of a whole new audience.  Start now.
> http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
> _______________________________________________
> edk2-commits mailing list
> edk2-comm...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-commits

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to