in reply to Re: Win32 Keyboard hook in perl
in thread Win32 Keyboard hook in perl

thanks bart you fixed something i obviously overlooked. Now back to the other 82 problems heh :\

Replies are listed 'Best First'.
Re^3: Win32 Keyboard hook in perl
by Anonymous Monk on Sep 10, 2004 at 04:15 UTC
    Ok now please enlighten me on the proper way to create a pointer with the win32::api mod. I tried what the docs said exactly, $foo = " " x 80;

      $hooker = $hook->Call($idHOOK, $lpfn, $hmod, $dwThreadId);

      IIRC, $lpfn is supposed to be a reference to a subroutine so that it can be used as a callback.

        Eh, what?!? No, a callback expects a pointer to some raw machine code (generally compiled C), which the CPU can then execute directly. Pure Perl won't do, you'll need an interface layer written in XS.

        I looked over CPAN, and found Win32::API::Callback, which probably can be used to get the desired effect. If it doesn't crash. :)