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

I am using Win32::GuiTest and the SendKeys function to simulate keyboard commands. My intent is to automate the hot key to toggle my folder protection. If I do it using the physical keyboard it works as expected, but through the Perl module I cannot get the program to trigger. The application I am attemptig to activate is Universal Shield by Everstrike.com. Any ideas?

Replies are listed 'Best First'.
Re: hot key not accepted
by Popcorn Dave (Abbot) on Apr 06, 2005 at 05:27 UTC
    You may want to google about this, but I seem to remember that to read extended keys, it's a combination of chr 27(esc) + the other key in the keyboard buffer. That's my recollection of how you used to read them in DOS back in my old Pascal programming days. I would assume that you would need to send them the same way.

    Hope that helps!

    Useless trivia: In the 2004 Las Vegas phone book there are approximately 28 pages of ads for massage, but almost 200 for lawyers.
      It seems to only be this particular program that is preventing me from using hotkeys through Perl. I have tried trial versions of several simliar security software and this is the ONLY one of the group that does not work. There MUST be something blocking the hotkey request.

      Oddly enough, I have noticed that none of the "special" keys work. If I use do a SendKeys using ALT or CTRL or F*, etc. they all fail. Although, I was able to do what I need by using "non-special" keyboard commands but it is a hack of hack if you catch my meaning. Still looking for a better solution/explanation??!!
Re: hot key not accepted
by BrowserUk (Patriarch) on Apr 06, 2005 at 05:57 UTC

    What key sequence are you trying to send, and how are you trying to send it?


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco.
    Rule 1 has a caveat! -- Who broke the cabal?
      I have tried sending CTRL-ALT-a and F6 and my hotkeys. Neiteher of them worked. The method in Win32::GuiTest is called SendKeys and supports sending these special characters. Documentation here:

      http://search.cpan.org/~erngui/Win32-GuiTest-1.3/GuiTest.pm

        I was asking to see your code. It is difficult to correct your attempt without seeing it.

        A guess: You are ensuring that the application you wish to receive the keystrokes, is the currently active window before using the SendKeys() function aren't you?


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        Lingua non convalesco, consenesco et abolesco.
        Rule 1 has a caveat! -- Who broke the cabal?