Hi all,
I have one that might not be possible...
What I'm doing is running a program with Open2, but need to send instructions to it when there is a single key-press. For that I'm using HotKey.pm from the Perl Cookbook.
The problem I run into is I need to wait on While which causes my other process to hang untill it gets that key. I want it to just run it and take the key-presses as they come so to speak. Here's a simplified version of what I mean:
Use HotKey.pm;
foreach $i (@things) {
&program_running($i);
while ($keyboard = readkey) { # This is the gotcha
if ($keyboard =~ /b/) {
print "you pressed b \n";
}
}
}
Is there any way to check for a key-press that does not wait? Sort of check it on the fly, or periodicly?
TIA,
Miker