Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

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 ); }

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re: Keep the playback rolling (Win32) by BrowserUk
in thread Keep the playback rolling (Win32) by tye

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others chilling in the Monastery: (7)
    As of 2020-03-30 17:19 GMT
    Find Nodes?
      Voting Booth?
      To "Disagree to disagree" means to:

      Results (175 votes). Check out past polls.