Look, you're being dense. You've got your application that does god knows what. And lots of other applications are running at the same time. These other applications are possibly expecting to get input from the keyboard when they have "focus"; and you want to steal characters from them when your application isn't in focus.

Your application shouldn't have to worry about intercepting ALL input EVER given to any other application, but that is exactly what will happen if you try to stuff this functionality into your application.

Now, there are ways to fxck with the GUI such that some given input is redirected away from the application that has "focus" and instead goes about and does something else. Fine, great, dandy; there are uses for this sort of thing. And wow, autohotkey, as an example, does just that! Chances are very good that, if your program isn't specifically geared to do exactly and only that, ie try to imitate all the difficult bits that autohotkey and others have figured out, you'll do a completely sucky job at it.

So, are you planning to write an imitation autohotkey all in perl? If so, I give you a pre-emptory -- for trying. You'd be screwing with user input with a language that will slow everything down a lot.

If not, use autohotkey or someother similar product to do the input redirection, then concentrate on making your program do the thing it's supposed to do, and make sure it does it well.

-Scott


In reply to Re^5: Creating keybinds GLOBALY! by 5mi11er
in thread Creating keybinds GLOBALY! by Ace128

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.