in reply to Term::Readkey GetConsoleMode error

ya but none of these are working for me... maybe i should just throw windows in the trash...

i could just write a c program that gets the input and just pipe it...

that would be bad for system resources

another thing about *nix, it is easy to do the input esp with stty... but perl is cross compatable for the most part

Replies are listed 'Best First'.
Re^2: Term::Readkey GetConsoleMode error
by asz (Pilgrim) on Mar 22, 2006 at 08:02 UTC
      InKey works thanks. For some reason Komodo still produces an error... maybe i gotta stop using komodo and just do the command line thing...
      Here is working code. The demo file in the distribution has some more to it.
      #!/usr/bin/perl use strict; use lib qw(.); use Term::InKey; my ($x,$bullet); $|=1; &Clear; print "Hit a key: "; $x = &ReadKey; &Clear; print "You typed $x";

      Komodo 3.52 spits out
      Hit a key:
      Not implemented on MSWin32: The handle is invalid at C:/Perl/lib/Term/InKey.pm line 32.

      again this works in regular dos

        And wow... *grumbles*

        I looked back at my old code and guess what... it works...

        I dont think ill be using komodo again anytime soon...

        update: well.. thanks to GrandFather's help (again), have worked around this problem with komodo. Set it to debug in a seperate window...