Keyboard input/Keypress check: Difference between revisions

Content added Content deleted
(→‎{{header|Perl 6}}: Add a Perl 6 example)
Line 542: Line 542:


This code prints <code>"doing something"</code> 10 times and then ends. Parallelly another process prints every key you type in.
This code prints <code>"doing something"</code> 10 times and then ends. Parallelly another process prints every key you type in.

=={{header|Perl 6}}==
{{works with|Rakudo|2018.10}}

<lang perl6>use Term::ReadKey;

react {
whenever key-pressed(:!echo) {
given .fc {
when 'q' { done }
default { .uniname.say }
}
}
}</lang>


=={{header|Phix}}==
=={{header|Phix}}==