Ahojte potreboval by som helpnúť s myškou v pascali. Program ktorý by mal vypisovať suradnice bodu kde kliknem my však nejde. Mohol by mi to niekto pomôcť opraviť pls. Dik
uses dos,crt;
var button,MysY,MysX:integer;
{inicializacia ovladaca mysi}
function Mys_init:boolean;
var reg:registers;
begin
reg.ax:=$0000;
intr($33, reg);
{button:=reg.bx;}
if reg.ax=$0000 then mys_init:=false
else mys_init:=true;
end;
{zobrazi kurzor mysi}
procedure Mys_view;
var reg:registers;
begin
reg.ax:=$0001;
intr ($33,reg);
end;
{zisti stlacenie a suradnice mysi}
procedure Mys_get(MysX,MysY,Button:integer);
var reg:registers;
Begin
reg.ax:=$0003;
intr ($33,reg);
MysX:=(succ(reg.cx)) div 8;
MysY:=(succ(reg.dx)) div 8;
Button:=reg.bx;
end;
{vypne/zapne kurzor}
procedure KurzorZap (ZapVyp:boolean);
var reg:registers;
begin
with reg do
begin
AH:=$03;
BH:=$00;
intr($10,reg);
if not(ZapVyp) then CH:=CH or $20
else CH:=CH and $DF;
AH:=$01;
intr($10,reg);
end;
end;
BEGIN
clrscr;
Mys_init;
Mys_view;
KurzorZap(false);
repeat
Mys_get(MysX,MysY,Button);
if (Button<>0) then
writeln('mys:',MysX,',',MysY);
until keypressed;
readkey;
END.