Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Term::ReadKey under win32

by perigeeV (Hermit)
on Apr 08, 2002 at 03:35 UTC ( [id://157358]=note: print w/replies, xml ) Need Help??


in reply to Term::ReadKey under win32

I have found that giving ReadKey() a timeout value seems to workaround this behavior. Instead of calling ReadKey(0), call it with an insane value: ReadKey(1000000000), or you can set it to one second and catch the timeout. Then just reissue the func call.


Replies are listed 'Best First'.
Re^2: Term::ReadKey under win32
by Anonymous Monk on Jul 03, 2007 at 12:19 UTC
    Hey I found some help alright. this is the script that works on win xp #!/usr/bin/perl -w use Term::ReadKey; print "Gimme a word: ";$|++; while (1) { $|++; ReadMode 5; $key = ReadKey (10); chomp ($key); ReadMode "normal"; printf "*"; $|++; #printf "\nYou said %s, char number %03d\n", #$key, ord $key; last if ($key =~ /\r\n/); } print "\n";

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-03-28 16:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found