macintosh_cookbook/examples/mouse.pas
2020-05-07 18:47:11 +09:00

35 lines
480 B
ObjectPascal

program ExampleMouse;
var
Pt: Point;
begin
ShowDrawing;
ShowText;
repeat {Until we double-click}
GetMouse(Pt);
{Button down message detector}
while button do
begin
Writeln('down', Pt.h, Pt.v);
repeat {Tight loop until button up}
until not Button;
end;
{ Button up message detector}
while not button do
begin
Writeln('up', Pt.h, Pt.v);
repeat {Tight loop until button down}
until button;
end;
until 1 > 1; { forever}
end.