From 5577c0a475e68830c1cdccf5abbcb5b45286763a Mon Sep 17 00:00:00 2001 From: Michael Gebetsroither Date: Fri, 9 Nov 2007 16:33:48 +0100 Subject: [PATCH] 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. --- usr_sbin/grml-quickconfig | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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.$/.$/; -- 2.1.4