Loading ...
Sorry, an error occurred while loading the content.

SendRawKey problems...

Expand Messages
  • Steve Loughran
    Hi all Been banging my head against this for the last 2-3 hours, and its driving me nuts. ActivePerl 5.8.6. Win32 Gui Test v1.50.5 (install from ppd
    Message 1 of 4 , Mar 13, 2006
    • 0 Attachment
      Hi all

      Been banging my head against this for the last 2-3 hours, and its
      driving me nuts.

      ActivePerl 5.8.6.<something>
      Win32 Gui Test v1.50.5 (install from ppd file)

      I cannot get SendRawKey to send *anything* to the active window (testing
      with Notepad right now). I want to be able to send Left Alt Down, Left
      Alt Up, but its not sending anything at all... nothing...

      I searched the archives and found:

      ===========

      For the ALT key, you could use
      Press: SendRawKey(VK_LMENU, KEYEVENTF_EXTENDEDKEY);
      Release: SendRawKey(VK_LMENU, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP);

      ===========

      and looked through the guitest.pm for the correct usage and any other
      tips I could find.

      I managed to get SetFocus() + SendKeys() working first time, but
      SendRawKey() is infuriating me :)

      Many thanks for your help!!

      Steve
    • Alex Morozov
      Can you provide your sample code?
      Message 2 of 4 , Mar 13, 2006
      • 0 Attachment
        Can you provide your sample code?

        > Hi all
        >
        > Been banging my head against this for the last 2-3 hours, and its
        > driving me nuts.
        >
        > ActivePerl 5.8.6.<something>
        > Win32 Gui Test v1.50.5 (install from ppd file)
        >
        > I cannot get SendRawKey to send *anything* to the active window (testing
        > with Notepad right now). I want to be able to send Left Alt Down, Left
        > Alt Up, but its not sending anything at all... nothing...
        >
        > I searched the archives and found:
        >
        > ===========
        >
        > For the ALT key, you could use
        > Press: SendRawKey(VK_LMENU, KEYEVENTF_EXTENDEDKEY);
        > Release: SendRawKey(VK_LMENU, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP);
        >
        > ===========
        >
        > and looked through the guitest.pm for the correct usage and any other
        > tips I could find.
        >
        > I managed to get SetFocus() + SendKeys() working first time, but
        > SendRawKey() is infuriating me :)
        >
        > Many thanks for your help!!
        >
        > Steve
        >
        >
        >
        > Yahoo! Groups Links
        >
        >
        >
        >
        >
        >
        > .
        >
        >
      • Steve Loughran
        oops... I had a brain meltdown, its all working and doing what it should be doing now. Sorry to take up your time... Steve (I never make the same mistakes
        Message 3 of 4 , Mar 14, 2006
        • 0 Attachment
          oops... I had a brain meltdown, its all working and doing what it should
          be doing now.

          Sorry to take up your time...

          Steve
          (I never make the same mistakes twice, I always find new ones to make)

          Alex Morozov wrote:
          > Can you provide your sample code?
          >
        • Dennis K. Paulsen
          In your Win32::GuiTest import line (use Win32::GuiTest qw(...)), make sure your including SendRawKey and the appropriate tag (:ALL, etc.) to import the
          Message 4 of 4 , Mar 26, 2006
          • 0 Attachment
            In your Win32::GuiTest import line (use Win32::GuiTest qw(...)),
            make sure your including SendRawKey and the appropriate tag (:ALL,
            etc.) to import the VK_LMENU, etc. constants... Also make sure your
            using "use strict;" and "use warnings;"; which can help any
            developer a lot.... Also check out Win32GUITest.exe from the
            project website.. It creates a script from your interactions. Even
            though its in early stages and doesn't handle many control
            functions, it may help if your getting use to SendRawKey....

            Hope that helped.

            Regards,
            Dennis K. Paulsen


            --- In perlguitest@yahoogroups.com, Alex Morozov <inductor2000@...>
            wrote:
            >
            > Can you provide your sample code?
            >
            > > Hi all
            > >
            > > Been banging my head against this for the last 2-3 hours, and
            its
            > > driving me nuts.
            > >
            > > ActivePerl 5.8.6.<something>
            > > Win32 Gui Test v1.50.5 (install from ppd file)
            > >
            > > I cannot get SendRawKey to send *anything* to the active window
            (testing
            > > with Notepad right now). I want to be able to send Left Alt
            Down, Left
            > > Alt Up, but its not sending anything at all... nothing...
            > >
            > > I searched the archives and found:
            > >
            > > ===========
            > >
            > > For the ALT key, you could use
            > > Press: SendRawKey(VK_LMENU, KEYEVENTF_EXTENDEDKEY);
            > > Release: SendRawKey(VK_LMENU, KEYEVENTF_EXTENDEDKEY |
            KEYEVENTF_KEYUP);
            > >
            > > ===========
            > >
            > > and looked through the guitest.pm for the correct usage and any
            other
            > > tips I could find.
            > >
            > > I managed to get SetFocus() + SendKeys() working first time, but
            > > SendRawKey() is infuriating me :)
            > >
            > > Many thanks for your help!!
            > >
            > > Steve
            > >
            > >
            > >
            > > Yahoo! Groups Links
            > >
            > >
            > >
            > >
            > >
            > >
            > > .
            > >
            > >
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.