Detecting keypress when window isn't in focus
- From: Chris Wilkins <chris.wilkins1@xxxxxxxxx>
- Date: Fri, 25 Jul 2008 00:53:08 -0700 (PDT)
I have a script which loops forever and I need a way to break out of
the loop with a keypress. I can do this with the script below and it
works fine, my problem is that if I take the focus away from the
command window that the script is running in, the keypress isn't
recognised and the loop doesn't end.
use Win32::GuiTest qw/:ALL/;
my $i = 0;
my $char = ReadKey(-1);
if ($char eq 'q')
Is there a way (with Term::ReadKey or anything else) of detecting a
keypress when the script window does not have focus?
- Prev by Date: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.8 $)
- Next by Date: Re: Detecting keypress when window isn't in focus
- Previous by thread: FAQ 4.5 How do I convert between numeric representations/bases/radixes?
- Next by thread: Re: Detecting keypress when window isn't in focus