From: Michael Gebetsroither Date: Fri, 9 Nov 2007 15:33:48 +0000 (+0100) Subject: reverted grml-quickconfig: no more unnecessary wakeups X-Git-Tag: 1.0.25~2 X-Git-Url: http://git.grml.org/?p=grml-scripts.git;a=commitdiff_plain;h=5577c0a475e68830c1cdccf5abbcb5b45286763a reverted grml-quickconfig: no more unnecessary wakeups Term::ReadKey seems to be buggy, the normal blocking call ReadKey(0) is not blocking anymore after returning from an grml-x started through grml-quickconfig. --- diff --git a/usr_sbin/grml-quickconfig b/usr_sbin/grml-quickconfig index a8a0df0..a7c2a9b 100755 --- a/usr_sbin/grml-quickconfig +++ b/usr_sbin/grml-quickconfig @@ -10,6 +10,7 @@ # menu with quick config options use Term::ReadKey; +use Time::HiRes; # enable alternate charset support (needed for screen) print "\e(B\e)0"; @@ -99,7 +100,10 @@ while(1) { EOF print "Press a key: ".$M; ReadMode 4; # Turn off controls keys - while (not defined ($x = ReadKey(0))) {} + while (not defined ($x = ReadKey(-1))) { + # No key yet + Time::HiRes::sleep(0.5); + } ReadMode 0; # Reset tty mode before exiting print $N.$/.$/; @@ -122,7 +126,10 @@ EOF EOF print "Press a key: ".$M; ReadMode 4; # Turn off controls keys - while (not defined ($x = ReadKey(0))) {} + while (not defined ($x = ReadKey(-1))) { + # No key yet + Time::HiRes::sleep(0.5); + } ReadMode 0; # Reset tty mode before exiting print $N.$/.$/;