Keyboard input/Keypress check: Difference between revisions
+perl
(+perl) |
|||
Line 449:
System.Console receiveChar ->aChar // Wait until a character is pressed. All other keys are ignored
System.Console receiveTimeout(0) ->key // Check if a key is pressed and return immediatly</lang>
=={{header|Perl}}==
<lang perl>#!/usr/bin/perl
use strict;
use warnings;
use Term::ReadKey;
ReadMode 4;
my $key;
until(defined($key = ReadKey(-1))){
# anything
}
print "got key '$key'\n";
ReadMode 0;</lang>
=={{header|Phix}}==
|