How can I intercept keyboard events with Perl?
Is there any way on Perl to identify if a keyboard event is triggered on Win32 before the key itself reach its GUI application开发者_运维问答 ?
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?
Just researched this, and I think this is what you need.
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.
精彩评论