ReadMode('cbreak'); : Term « System Functions « Perl






ReadMode('cbreak');

    

use Term::ReadKey;

ReadMode('cbreak');

if (defined ($char = ReadKey(-1)) ) {
    print "This key was waiting: $char.";
} else {
    print "Sorry, no key was waiting.";
}

ReadMode('normal');        

   
    
    
    
  








Related examples in the same category

1.use Term::ReadKey;
2.Get Terminal Size
3.Set new prompt letter for terminal when reading data
4.Read password without displaying anything
5.use Term::ANSIColor;