unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls;

type
  TForm1 = class(TForm)
    Timer1: TTimer;
    procedure Timer1Timer(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  ShagX,ShagY:Real;
  PointBack:Tpoint;
implementation

{$R *.dfm}

procedure TForm1.Timer1Timer(Sender: TObject);
var point:tPoint;i1:integer;
ZnakX,ZnakY:integer;
const MyDiv=1.3;MyEndX=1.2;MyDivX=5;
MyEndY=1.1;MyDivY=3;
begin
GetCursorPos(point);
if (PointBack.x=point.x)and(PointBack.y=point.y) Then Exit;
ShagX:=point.x-PointBack.x;
ShagY:=point.y-PointBack.y;
{SHagX:=ShagX /MyDiv;
SHagY:=ShagY / MyDiv;}
if ShagX>0 then ZnakX:=1 else ZnakX:=-1;
if ShagY>0 then ZnakY:=1 else ZnakY:=-1;
ShagX:=ABS(ShagX);
ShagY:=Abs(ShagY);
if (ShagX>MyDivX) then ShagX:=ShagX/MyDiv
 else ShagX:=SQRT(ShagX);

if (ShagY>MyDivY) then ShagY:=ShagY/MyDiv
 else ShagY:=SQRT(ShagY);
if ShagX<MyEndX then ShagX:=0;
if ShagY<MyEndY then ShagY:=0;

ShagX:=ShagX*ZnakX;
ShagY:=ShagY*ZnakY;
{If Abs(ShagX)<MyEndX then SHagX:=ShagX /MyDivX;
If Abs(Shagy)<MyEndY then SHagY:=ShagY /MyDivY;}
{If (Abs(ShagX)>MyEndX)and(Abs(ShagY)>MyEndY) then}
SetCursorPos(Round(point.x+SHagX),Round(point.y+SHagY));
PointBack.x:=Point.x;
PointBack.y:=Point.y;
end;

procedure TForm1.FormCreate(Sender: TObject);
var point:tPoint;i1:integer;
begin
GetCursorPos(point);
PointBack:=point;
end;

end.
