Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I make the mouse jump?

Status
Not open for further replies.

LEICJDN1

Technical User
Nov 27, 2002
201
GB
Need to make the mouse jump to certain positions on the screen to ease default button choices during certain actions.

How can I specify the mouse co-ordinates and force the mouse to jump there?

Thanks!
 
Check out my thread on simulating mouse clicks: thread102-396562. It uses a API call called mouse_event which you can also use to move the mouse to a desired location. The above thread contains a link to msdn which explains the use of mouse_event. Below is another link which shows a simulated mouse move and mouse click:
Clive [infinity]
 
You can also just use SetCursorPos.

var
MouseCoor : TPoint;

begin
MouseCoor.x := 10;
MouseCoor.y := 10;

//to use Form's coordinates not the whole desktop
MouseCoor := ClientToScreen(MouseCoor);

SetCursorPos(MouseCoor.x, MouseCoor.y);

 
Sorry for the late reply but thank you both. Implemented Stretchwickster's technique fine, but may try BTecho's method also.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top