jsteng has asked for the wisdom of the Perl Monks concerning the following question:

Is there a perl function that is equivalent of AutoIt's HotKeySet function?

I want to bind a set of keypresses such as:
CTRL-ALT-U
CTRL-ALT-P
etc
but without having the script in focus (such as the case with TK Bind).


Thanks.
  • Comment on Perl's equivalent to Autoit's HotKeySet?

Replies are listed 'Best First'.
Re: Perl's equivalent to Autoit's HotKeySet?
by jsteng (Beadle) on May 08, 2018 at 10:02 UTC
    Thanks to the 2 people above, I found something at Win32 that gives such a functionality:

    Win32::GlobalHotkey - Use System-wide Hotkeys independently

    Thanks!
Re: Perl's equivalent to Autoit's HotKeySet?
by Athanasius (Archbishop) on May 08, 2018 at 06:13 UTC
      Win32::AutoItX - Automate the Windows GUI using AutoItX

      Unfortunately, it is for AutoIt's GUI module. Something that I got stuck at AutoIt and decided to redo my codes in Perl.
Re: Perl's equivalent to Autoit's HotKeySet?
by LanX (Saint) on May 08, 2018 at 08:48 UTC
      Honestly, I once used Win32::GuiTest a long long time ago for such a purpose. I had my main loop listening to the keypresses until the appropriate sequence occurs then call the functions. It behaved like a keylogger which IMO is highly suspicious.

      Then I rewrote the script into AutoIt because it had HotKeySet function.

      However, when I got stuck with AutoIt's GUI, I decided to stick with Perl for good.