in reply to a ReadKey problem

Which OS are you using? Behavior of the Term varies even in Win32 cmd vs command.com. (added this).. and make sure you are setting binmode... something like so:
ReadMode 3; # stty mode binmode STDIN, ":raw"; while($key = ReadKey()){ print ord $key; }
before you grab a key or you will get funky stuff :)

Replies are listed 'Best First'.
Re: Re: a ReadKey problem
by Pardus (Pilgrim) on Jan 28, 2003 at 13:58 UTC
    Mostly linux, but it should be portable -- but shouldn't ReadKey do OS dependent stuff for me ?
    --
    Jaap Karssenberg || Pardus (Larus)? <pardus@cpan.org>
    >>>> Zoidberg: So many memories, so many strange fluids gushing out of patients' bodies.... <<<<

      It's not really OS dependant, actually. It depends on the terminal / terminal emulator you're using. Term::ReadKey is more low-level, and assumes you will figure out what terminal-type the user has and interpret accordingly.

      Perhaps you should look at the source of Term::Readline::Perl to see how it handles multi-char escape sequences, as it uses a similar system as you, with the hashes and all.

      bbfu
      Black flowers blossum
      Fearless on my breath