Hello POE,

I noticed the problem that Bruno Boettcher was having with
POE::Wheel::ReadLine and I am having a similar problem. I'm writing in
with my observations.

First, system is Linux 2.4.20, Perl is 5.8.0, POE is 0.26.
Term::ReadKey is 1.7. I'm using libtermcap-compat, which may not be the
same as libtermcap.

The first character entered is handled normally. The second character
entered puts the program into a loop where the wheel's 'select read' event
is called repeatedly; however, ReadKey(-1) returns an undefined value, so
the keys aren't actually delivered to the program. When I terminate the
program using 'kill' from another terminal, the characters that I typed
show up on the command line for the shell - which I guess means they were
buffered but not consumed by a read from perl.

I don't think that this is a problem with POE per se, because the test
program show in 'perldoc Term::ReadKey' doesn't seem to work either.

#!/usr/bin/perl

use Term::ReadKey;

ReadMode 5; # Turn off controls keys
while (1) {
  while (not defined ($key = ReadKey(-1))) {
    print "Foo\n";
    sleep (1);
  }
  print "Get key $key\n";
  ($key eq 'q') and last;
}
ReadMode 0; # Reset tty mode before exiting


This program works with ReadKey(0) and ReadKey(1). I haven't further
debugged Perl's Term::ReadKey, but I thought I'd drop a line here in case
someone was still working on it.

I'd appreciate any ideas that anyone has.

Thanks for your time,
Phil Nadeau
[EMAIL PROTECTED]
[EMAIL PROTECTED]


Reply via email to