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.
# menu with quick config options
use Term::ReadKey;
# menu with quick config options
use Term::ReadKey;
# enable alternate charset support (needed for screen)
print "\e(B\e)0";
# enable alternate charset support (needed for screen)
print "\e(B\e)0";
EOF
print "Press a key: ".$M;
ReadMode 4; # Turn off controls keys
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.$/.$/;
ReadMode 0; # Reset tty mode before exiting
print $N.$/.$/;
EOF
print "Press a key: ".$M;
ReadMode 4; # Turn off controls keys
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.$/.$/;
ReadMode 0; # Reset tty mode before exiting
print $N.$/.$/;