develooper Front page | perl.perl6.users | Postings from September 2017

Re: What is P6 for P5 `use Term::ReadKey`?

Thread Previous | Thread Next
From:
ToddAndMargo
Date:
September 9, 2017 06:57
Subject:
Re: What is P6 for P5 `use Term::ReadKey`?
Message ID:
41c99586-3e46-248c-a113-04a2eae78437@zoho.com
On 09/08/2017 11:41 PM, ToddAndMargo wrote:
> Hi All!
> 
> I am trying to convert some Perl 5 code to Perl 6.
> 
> What do I use in place of
>      use Term::ReadKey qw ( ReadKey ReadMode );
> 
> I am trying to convert the following:
> 
> <code>
> use Term::ReadKey qw ( ReadKey ReadMode );
> 
> sub DumpKeyboard () {
>     # Dump the contents of the keyboard buffer, if any
>     my $Trash;
> 
>     ReadMode 4; # Turn off controls keys
>     while  ( defined ( $Trash = ReadKey ( -1, \*STDIN ) ) ) {
>        # print "\$Trash = $Trash\n";
>     }
>     ReadMode 1; # Reset tty mode before exiting
> }
> 
> </code>
> 
> 


This guy maybe?

https://github.com/krunen/term-termios/blob/master/README.md

I can't tell what he is saying.

And his example wont read a carriage return


-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Computers are like air conditioners.
They malfunction when you open windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About