kbhit() in Perl??? 
Author Message
 kbhit() in Perl???

Hy

Does anybody know, how to write the kbhit() function of C/C++ in Perl?
The function has to be usable for Unix/Linux...(so, it's not the same like
in conio.h of C/C++)

Functionality:
Return value is 0 when no key was pushed.
If a key was pushed, return value is != 0.

I hope someone has an answer for me.

Roman



Tue, 20 Apr 2004 05:16:25 GMT  
 kbhit() in Perl???
[Please set a "Followup-To" header when you crosspost, especially if you
feel the need to crosspost this widely. This message only goes to
comp.lang.perl.modules.]

On Thu, 1 Nov 2001 22:16:25 +0100, "Ernst Studer"

Quote:

> Does anybody know, how to write the kbhit() function of C/C++ in Perl?

Have a look in the Perl FAQ. `perldoc -q key` yields several bits of
useful code; one of them is `perldoc -q "input is ready"`.

Cheers,
Philip
--

That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.



Thu, 22 Apr 2004 03:28:48 GMT  
 kbhit() in Perl???

Quote:
> Hy

> Does anybody know, how to write the kbhit() function of C/C++ in Perl?
> The function has to be usable for Unix/Linux...(so, it's not the same like
> in conio.h of C/C++)

> Functionality:
> Return value is 0 when no key was pushed.
> If a key was pushed, return value is != 0.

> I hope someone has an answer for me.

The module Term::Screen has a method key_pressed() that does exactly this.

/J\
--
Jonathan Stowe                      |
<http://www.gellyfish.com>          |      This space for rent
                                    |



Thu, 22 Apr 2004 18:22:43 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. kbhit() in Perl???

2. kbhit() in Perl???

3. kbhit() in curseperl?

4. !kbhit() + system'stty raw -echo'

5. NYC: PERL PERL PERL PERL PERL PERL PERL

6. Perl, perl or PERL debate

7. Perl Golf mailing list - perl.golf on nntp.perl.org

8. Perl, Perl, Perl, don't give your love to URL

9. RFD - comp.lang.perl.db, comp.lang.perl.network, comp.lang.perl.regex

10. \c@ in Perl, perl & perl + modules

11. New dialect of perl: xperl (or reinventing perl, or perl-izing jpython)

12. Perl/Swing (Perl/AWT) as an eventual alternative to Perl/Tk

 

 
Powered by phpBB® Forum Software