thenetfreaker has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; # use some Win32 module for the task # the checking if anything been pressed logically combined with perl s +eems to me to look like my $trials = 20; # for 10 minutes while ($trials) { if (("mouse moved") or ("any key pressed")) { $trials = 20; # start the countdown all over again } else { $trials--; #decrease a trial sleep(30); #wait half a minute } } #now that $trials equals to 0 - therefore nothing been pressed for 10 +minutes (20 halves of a minute {for better results}) doMyFunc($var1, $var2); sub doMyFunc { ... }
now my question is how to properly implement the part of the code where perl should determine the "idle state" of Win32, in which the user neither presses anything nor moves the mouse ?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32 idle state (screensaver like)
by cdarke (Prior) on Sep 28, 2007 at 12:50 UTC | |
by halley (Prior) on Sep 28, 2007 at 14:31 UTC | |
by thenetfreaker (Friar) on Sep 28, 2007 at 15:51 UTC | |
by thenetfreaker (Friar) on Sep 28, 2007 at 12:59 UTC | |
|
Re: Win32 idle state (screensaver like)
by BrowserUk (Patriarch) on Sep 28, 2007 at 18:44 UTC | |
by thenetfreaker (Friar) on Sep 28, 2007 at 21:05 UTC | |
by BrowserUk (Patriarch) on Sep 28, 2007 at 21:38 UTC | |
by thenetfreaker (Friar) on Sep 28, 2007 at 22:20 UTC | |
by lodin (Hermit) on Oct 15, 2008 at 18:32 UTC |