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

$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.

Replies are listed 'Best First'.
Re^5: Win32 Keyboard hook in perl
by bart (Canon) on Sep 10, 2004 at 10:00 UTC
    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. :)

      I was speaking of the underlying API but I should have said that. I probably should have left it at "The API expects that position to hold a pointer to a callback function."