macintosh_cookbook/examples/mouse.pas

35 lines
480 B
ObjectPascal
Raw Normal View History

2020-05-07 09:47:11 +00:00
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.