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

any chance of adding the ability to click the mouse? ...

Expand Messages
  • Jonathan Epstein
    Positioning the mouse can be readily achieved using Win32::API, but clicking the mouse is much harder. Any chance of adding this to Win32::GuiTest and calling
    Message 1 of 3 , Nov 29, 2001
    • 0 Attachment
      Positioning the mouse can be readily achieved using Win32::API, but clicking the mouse is much harder. Any chance of adding this to Win32::GuiTest and calling it ButtonClick?

      Here's some code which doesn't work ;-) ... maybe this will provide the necessary hints to produce a working version?

      -Jonathan



      #my($PostMessage) = new Win32::API("user32","PostMessage","PIIN","I");
      #$PostMessage->call($explorer,$WM_LBUTTONDOWN,$MK_LBUTTON, $x + ($y << 16));
      #$PostMessage->call($explorer,$WM_LBUTTONUP,$MK_LBUTTON, $x + ($y << 16));

      my($mouse_event) = new Win32::API("user32","mouse_event","NNNNP","");


      $mouse_event->call($MOUSEEVENTF_LEFTDOWN,$x,$y,0,0);
      $mouse_event->call($MOUSEEVENTF_LEFTUP,$x,$y,0,0);
    • erngui@yahoo.com
      Hi, ... clicking the mouse is much harder. Any chance of adding this to Win32::GuiTest and calling it ButtonClick? General mouse input us already part of
      Message 2 of 3 , Nov 29, 2001
      • 0 Attachment
        Hi,

        --- In perlguitest@y..., Jonathan Epstein <Jonathan_Epstein@n...>
        wrote:
        > Positioning the mouse can be readily achieved using Win32::API, but
        clicking the mouse is much harder. Any chance of adding this to
        Win32::GuiTest and calling it ButtonClick?

        General mouse input us already part of GuiTest. The following snippet
        opens a paint program and draws a tiangle in it using the mouse:

        use Win32::GuiTest qw(MouseMoveAbsPix
        SendLButtonDown SendLButtonUp);
        system("start /max pbrush.exe");
        sleep 2;
        MouseMoveAbsPix(100,100);
        SendLButtonDown();
        MouseMoveAbsPix(500,500);
        MouseMoveAbsPix(100,500);
        MouseMoveAbsPix(100,100);
        SendLButtonUp();

        Also test.pl and the 'eg/paint*' samples that come with the
        distribution show how to use them.

        Hope this helps,
        Ernesto.
        --
        Ernesto Guisado
        mailto:erngui@...
        http://triumvir.org
      • erngui@yahoo.com
        Hi, ... but ... Re-reading my post, I just realized that I had misunderstood your question/query. You re right, what you are asking for isn t included in
        Message 3 of 3 , Dec 1, 2001
        • 0 Attachment
          Hi,

          --- In perlguitest@y..., erngui@y... wrote:
          > --- In perlguitest@y..., Jonathan Epstein <Jonathan_Epstein@n...>
          > wrote:
          > > Positioning the mouse can be readily achieved using Win32::API,
          but
          > clicking the mouse is much harder. Any chance of adding this to
          > Win32::GuiTest and calling it ButtonClick?

          Re-reading my post, I just realized that I had misunderstood your
          question/query.

          You're right, what you are asking for isn't included in GuiTest and
          it would be useful.

          The next version of GuiTest will include something similar.

          Regards,
          Ernesto.

          --
          Ernesto Guisado
          mailto:erngui@...
          http://triumvir.org
        Your message has been successfully submitted and would be delivered to recipients shortly.