redss has asked for the wisdom of the Perl Monks concerning the following question:
The following code snippet uses Win32::Event and waits for an event, but is there a way for it to be interrupted by a user keypress?
use Win32::Event;
my $event = new Win32::Event( 0, 0, "MyEvent.$$" );
while (1) {
$rv = $event->wait(1000); # wait 1 sec
if ($rv) {
print "called via event\n";
} else {
print "timeout\n";
}
}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32::Event question
by ikegami (Patriarch) on Jul 19, 2005 at 21:01 UTC | |
by redss (Monk) on Jul 20, 2005 at 20:09 UTC | |
by ikegami (Patriarch) on Jul 20, 2005 at 20:26 UTC | |
by redss (Monk) on Jul 21, 2005 at 03:47 UTC | |
by redss (Monk) on Jul 21, 2005 at 15:01 UTC | |
by ikegami (Patriarch) on Jul 21, 2005 at 15:12 UTC |