开发者

How can I intercept keyboard events with Perl?

开发者 https://www.devze.com 2022-12-12 02:14 出处:网络
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 t

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消