Sign in Join
FPDoc Onlineexperiment

SetMouseXY procedure

In unit Mouse

Set the mouse cursor position.

Declaration

pascal
procedure SetMouseXY(x: Word; y: Word)

Description

SetMouseXY places the mouse cursor on X,Y. X and Y are zero based character coordinates: 0,0 is the top-left corner of the screen, and the position is in character cells (i.e. not in pixels).

Errors

None.

See also

Example: ex7

pascal
Program Example7;

{ Program to demonstrate the SetMouseXY function. }

Uses mouse;

begin
  InitMouse;
  Writeln('Click right mouse button to quit.');
  SetMouseXY(40,12);
  Repeat
    Writeln(GetMouseX,',',GetMouseY);
    If (GetMouseX>70) then
      SetMouseXY(10,GetMouseY);
    If (GetMouseY>20) then
      SetMouseXY(GetMouseX,5);
  Until (GetMouseButtons=MouseRightButton);
  DoneMouse;
end.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.