Press any key to continue... bug?



A little thing that's been bugging me for quite a long time:
Using mc I get the habit of F10 to cancel things, so when I
run something from the F2 user menu and it asks me to
"Press any key to continue..." I seem to tap F10 by habit, which
leaves a bunch of junk on the command line when the panels
return, which I have to backspace though.
This little hack uses read() to suck the keyboard dry so that
I'm not left with chars in the buffer, and I have a nice clean
commandline.

Does this seem like a reasonable approach?

--
Peace and Cheers.




--- main.c~	Wed Mar 12 11:39:38 2003
+++ main.c	Wed Nov 19 12:26:41 2003
@@ -542,7 +542,9 @@
 	    last_paused = 1;
 	    fflush (stdout);
 	    mc_raw_mode ();
-	    getch ();
+//	    getch ();
+	    unsigned char key[16];
+	    read( fileno(stdin), &key, 15 );
 	}
 	if (console_flag) {
 	    if (output_lines && keybar_visible) {






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]