in reply to Re: Reading all nonblocking keystrokes in Win2000
in thread Reading all nonblocking keystrokes in Win2000

You need to grab the source for the Term::ReadKey module and look at the *.xs file(s), which contain C code. This is almost certainly where you will find Win32Peek().

What I find is Win32PeekChar() which it appears that you can call like:

require Term::ReadKey; my $char= Term::ReadKey::Win32PeekChar(STDIN,-1);

        - tye (but my friends call me "Tye")

Replies are listed 'Best First'.
Re: (tye)Re: Reading all nonblocking keystrokes in Win2000
by Washizu (Scribe) on Nov 19, 2001 at 21:40 UTC

    Thanks for the tip on how to call the function. I found the source for ReadKey.xs, which contains Win32PeekChar(). The problem is that I haven't figured out how to replace ReadKey.xs. I found the file on the web, not on my machine, so I'm not sure where it is stored or compiled. It must be somewhere, but I'm not quite sure yet.

    -----------------------------------
    Washizu
    The best offense is a good offense.

      *.xs files are turned into *.c files that are then compiled into shared libraries (DLLs on Windows). Read perldoc perlxstut, perldoc perlxs, perldoc perlmod, and perldoc perlmodlib for more information.

      If you want to make (changes to) *.xs code under Windows, then you really want WinNT or later and the same C compiler that was used to build your version of Perl (which means Microsoft Visual C++ unless you have an unusual distribution of Perl installed).

              - tye (but my friends call me "Tye")