I'm trying to very simply get key press input from the input buffer using Win32::Console. For some reason, the Input() method always returns a list of one element whose value is "" rather than a list describing the next event. Then when the program exits, all the keypresses are dumped to the command line at once. I've been trying an assortment of different things with the Alloc(), Free(), Select() and Mode() methods. I've read microsoft's documentation on the subject but still am stuck.

On my scratchpad is the source to the module where I'm using Win32::Console right now. Eventually, my whole program will have lots of different modules that have their own Win32::Console objects. Each module will be called to do a specific task. for example this module is going to be a file selector. Anyway, the object of _my_ module is created in the main program with its new() method. After which I call Start() and Title() to set up some stuff and run it with it's Run() method. You can see how Run() calls the MainLoop() and, when I get it working, eventually it'll return a path to a file they select. The problem is in the main loop. If anyone can help me please do. I'm having trouble finding good documentation and examples.

In reply to Win32::Console Input Buffer Problem by Android 18

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.