Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-09

(no subject)

3 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

Michael wrote

What do you mean with mouse_event ?

May be if I give the Delphi code, you understand better than with a lot of sentences.

procedure LikeMouseClick(PositionClick_X : integer; PositionClick_Y : integer;
BackToPositionOrigine : Boolean = True);
var
  SavePointOrigine: TPoint;
begin
   GetCursorPos(SavePointOrigine);
   try
      SetCursorPos(PositionClick_X, PositionClick_Y);
      mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
      mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
   finally
      if BackToPositionOrigine then
         SetCursorPos(SavePointOrigine.X, SavePointOrigine.Y);
   end;
end;

If I code

LikeMouseClik(10,10,true);

in my program, the mouse pointer goes back to [10,10], so I don't have to physically click in a window to set focus.

Reply by email

Luca Olivetti
to Unknown author

En/na ha escrit:

Show quoted text 6 lines
If I code LikeMouseClik(10,10,true); in my program, the mouse pointer goes back to [10,10], so I don't have to physically click in a window to set focus.

I never used it, but there's a component (look in the components directory) called mouseandkeyinput that should do just that.

Bye

Luca Olivetti Wetron Automatizaci?n S.A. http://www.wetron.es/ Tel. +34 93 5883004 (Ext.133) Fax +34 93 5883007

Reply by email

Reimar Grabowski
to Luca Olivetti
I never used it, but there's a component (look in the components directory) called mouseandkeyinput that should do just that.

Or you can use:

var Mouse: TMouse;
// init
Mouse:=TMouse.Create;
// set position
Mouse.SetCursorPos:=NewCursorPos;

R.

A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail?

Reply by email