> Did you search the FAQ?  perldoc -q keyboard:

I did, actually.  Perhaps I'm misunderstanding it, because it appeared to 
me as though all of the proposed solutions would loop until a key was 
pressed, and/or weren't compatible with MacOS.  For instance:

>        The Term::ReadKey module from CPAN may be easier to use.
>        Recent versions include also support for non-portable
>        systems as well.
> 
>            use Term::ReadKey;
>            open(TTY, "</dev/tty");
>            print "Gimme a char: ";
>            ReadMode "raw";
>            $key = ReadKey 0, *TTY;
>            ReadMode "normal";
>            printf "\nYou said %s, char number %03d\n",
>                $key, ord $key;

If this worked the way I need, it would be reporting "You said (nothing)"  
before the user even got a chance to press a key.  I'd try it anyway,
since I've seen documentation for ReadKey which indicates that it's
non-blocking.  However, a search indicated that ReadKey was heavily
dependent on terminal characteristics that didn't apply to Macs, and that
it had never been ported to MacPerl to the best of the author's knowledge.

It's entirely possible that I'm just being dense, but similar problems
seem to apply to the other suggestions...

Ethan

Reply via email to