I needed to apply a patch to get this running on my Linux box. Would be
great if you could apply the attached patch to the CPAN distribuion.
Here's the details:
It appears that at startup, there's always 2-3 garbage characters in
STDIN, which confuse Curses so that it's always one character behind
what the user types. I found that if I throw away the garbage characters
at startup (only in the non-forced gpm mode, btw., otherwise test case
t/12gpm_handler.t fails), the GUI works fine. Patch attached.
Thanks for a great module!
-- Mike Schilli
Subject: | patch.txt |
diff -Naur Curses-UI-POE-0.02801/POE.pm Curses-UI-POE-0.02801.patched/POE.pm
--- Curses-UI-POE-0.02801/POE.pm 2004-06-24 13:16:18.000000000 -0700
+++ Curses-UI-POE-0.02801.patched/POE.pm 2006-06-03 12:39:08.475459392 -0700
@@ -63,6 +63,12 @@
set_read_timeout($ModalObject[TOP]);
+ unless($Curses::UI::gpm_mouse) {
+ while (my $key = $_[HEAP]->get_key(0) != -1) {
+ # ignoring stdin garbage at startup
+ }
+ }
+
$_[HEAP] = $RootObject;
$Options{inline_states}{_start}(@_)