This is a sort of complicated problem, but probably has a really easy solution! So please bear with me.

I'm trying to write a program in windows so that no matter what window is active, a certain key or series of keystrokes will be output to that active window. For instance, this program is running in the background so when I have microsoft word open I could have the letter H be pushed every 10 seconds, but then I switch windows to notepad and every 10 seconds h is still being pushed. I need to be able to select a window and have the keystrokes output.

The purpose of this program is to help automate some work that needs to be done, and it's a lot easier than getting 16 of the little birds like from the simpsons to literally push the keys!

I've only programmed a chat bot in perl so my experience is a little limited, but a friend said I should try perl to see if it could do what I need. I just thought you guys know what's going on, so why not see if you had any ideas.

Just even a step in the right direction would be greately appreciated. Thanks a ton!

Alan


In reply to Keystroke output help needed! by alpal

Title:
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, details, 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, summary, 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.