--- term/ieee1275/ofconsole-bk.c 2008-11-18 17:00:46.000000000 +0100 +++ term/ieee1275/ofconsole.c 2008-11-18 16:59:50.000000000 +0100 @@ -146,7 +146,10 @@ static int grub_ofconsole_readkey (int *key) { char c; + char ctmp; grub_ssize_t actual = 0; + grub_ssize_t actualtmp = 0; + char implemented = 1;//indicates an unimplemented key grub_ieee1275_read (stdin_ihandle, &c, 1, &actual); @@ -165,8 +168,11 @@ grub_ofconsole_readkey (int *key) } if (c != 91 ) - return 0; - + { + implemented = 0; + break; + } + grub_ieee1275_read (stdin_ihandle, &c, 1, &actual); if (actual <= 0) @@ -202,12 +208,25 @@ grub_ofconsole_readkey (int *key) /* Left: Ctrl-b. */ c = 2; break; + default: + implemented = 0; + break; } break; } + + /*stores actual state*/ + ctmp = c; + actualtmp = actual; + /*clean buffer*/ + while(actual > 0 && !grub_ieee1275_read(stdin_ihandle, &c, 1, &actual)); + /*return to previos state*/ + c = ctmp; + actual = actualtmp; *key = c; - return actual > 0; + return (actual > 0 && implemented); + } static int