tags:

views:

144

answers:

2

Is there any way on Perl to identify if a keyboard event is triggered on Win32 before the key itself reach its GUI application ?

+2  A: 

As with any other language, you can use the Windows API to install a hook.

I doubt it will be worth the effort. Why not try AutoHotKey?

Sinan Ünür
A: 

Just researched this, and I think this is what you need: http://bit.ly/bVySIr

It's an example script that uses RegisterHotkey (in the same way that AutoHotKey does) to have your script catch a keypress, even when it doesn't have focus. For my needs, it's much better to have my Perl script do this instead of relying on a separate program to forward the keypress.