Thor
Thor

Reputation: 201

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 ?

Upvotes: 0

Views: 917

Answers (2)

user437150
user437150

Reputation: 1

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.

Upvotes: 0

Sinan Ünür
Sinan Ünür

Reputation: 118166

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?

Upvotes: 2

Related Questions