Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Problem with ReadKey

by jethro (Monsignor)
on Nov 04, 2010 at 12:55 UTC ( [id://869453]=note: print w/replies, xml ) Need Help??


in reply to Problem with ReadKey

Worked fine on Suse Linux 11.3 64bit. Here my test script:
#!/usr/bin/perl use Term::ReadKey; use Time::HiRes qw(time); ReadMode 3; # 'noecho'; while (1) { my $key; my $wait_until = time + 3; while ( time < $wait_until ) { $key = ReadKey( -1 ); if ( defined $key ) { print STDERR "keystroke $key\t"; } } print "Something\n"; }

Be prepared to type in perl -e 'use Term::ReadKey; ReadMode 1;' blindly after executing the script to gt a working terminal again ;-)

Maybe some security feature (SELinux or AppArmor) gets in the way on your machine

Replies are listed 'Best First'.
Re^2: Problem with ReadKey
by Fox (Pilgrim) on Nov 04, 2010 at 15:04 UTC
    Be prepared to type in perl -e 'use Term::ReadKey; ReadMode 1;' blindly after executing the script to gt a working terminal again ;-)
    or reset

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://869453]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-19 19:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found