Warning!

Notice: the grml team is migrating from Mercurial to Git.
Please visit git.grml.org instead!

reverted grml-quickconfig: no more unnecessary wakeups
authorMichael Gebetsroither <michael.geb@gmx.at>
Fri Nov 09 16:33:48 2007 +0100 (12 months ago)
changeset 22103dbe896dc03
manifest03dbe896dc03
parent 22084f9e6d8cda1
child 22515881cc55d36
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
--- a/usr_sbin/grml-quickconfig Fri Nov 09 11:49:06 2007 +0100
+++ b/usr_sbin/grml-quickconfig Fri Nov 09 16:33:48 2007 +0100
@@ -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 @@ 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.$/.$/;
@@ -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.$/.$/;