A variation on your theme, I for the first time had a use for this--watching F1 practice sessions via the web and my screen saver kept kicking in. As I can't use Win32::API, I grabbed your code.
There were a couple of things that bugged me. I found the diamond pattern a little distracting. And if I used the mouse to adjust the volume or dismiss an email notification, the loop terminated and I had to switch away to restart it.
So I reduced the movement to a simple +1/-1 giggle at a reduced frequency and made it so that it wouldn't quit the loop until I moved the mouse to the top left corner.
#!/usr/bin/perl -w use strict; use Win32::GuiTest qw< GetCursorPos MouseMoveAbsPix >; my( $x, $y )= GetCursorPos(); my $toggle = 1; while( sleep 5 ) { my( $x1, $y1 )= GetCursorPos(); exit unless $x1 or $y1; ( $x, $y ) = ( $x1, $y1 ), next unless $x == $x1 && $y == $y1; $x = $x1 + $toggle; $y = $y1 + $toggle; $toggle *= -1; MouseMoveAbsPix( $x, $y ); }
In reply to Re: Keep the playback rolling (Win32)
by BrowserUk
in thread Keep the playback rolling (Win32)
by tye
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |