Yes, it can be done with VB.. and as far as I know, there's no way to do it that's completely Perl. Here's why..

First, you have to create a "System Wide Hook". This is done by creating a DLL. You can't do that in Perl. A "Hook" is basically a low level operation where you create a callback to an API function. In your case, you'd have to hook the Keyboard API. You can probably use Win32::API to create the app that loads the DLL, but not the DLL itself.

Pick your poision.. VB or C++ for the DLL. There's info on VB here. There's something in C++ here but it involves more than just the keyboard.

I could be wrong, but I'm pretty sure there's no pure Perl way to do it.

If you're interested in some more advanced stuff, there's also Detours Which will inject code into an apps memory space, replacing functions in the app.

Rich


In reply to Re: Keystoke Logger by rchiav
in thread Keystoke Logger by Anonymous Monk

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.