To juz mam tylko nie załączyłem bo nie chodzi mi o myszke tylko o klawiature !! :]
p_mouse(x,y,b);
to ta procka
Oto moje procki nie są profesionalne ale od czegoś trzeba zacząć :D
unit grafika;
interface
uses crt,graph,dos; {Dodaje moduy}
procedure start(patch:string);
procedure s_mouse(yes:boolean);
procedure p_mouse(var x,y,b:word);
procedure klaw(var klawisz:byte);
procedure czytaj_txt(patch:string;x,y:integer;color:word);
function inttostr(i:integer):string;
procedure pisz_txt(var s:string;var x,y:byte);
procedure ramka(x,y,maxx,maxy:integer;color:word);
implementation
procedure start(patch:string); {Procedura inicjujaca tryb graficzny}
var
karta,tryb:integer;
begin
DetectGraph(karta,tryb);
InitGraph(karta,tryb,patch);
if GraphResult <> grOK then Writeln('Graphics error:', GraphErrorMsg(GraphResult));
end;
procedure s_mouse(yes:boolean); {WYswietla mysz na ekranie}
var
r:registers;
begin
if yes = TRUE then
begin
r.ax:=$0001;
Intr($33,r);
end
else
begin
r.ax:=$0000;
Intr($33,r);
end;
end;
procedure p_mouse(var x,y,b:word); {Pobiera stan myszu pozycje i stan przycisk˘w}
var
r:registers;
begin
r.ax:=$0003;
Intr($33,r);
x:=r.cx;
y:=r.dx;
b:=r.bx;
end;
procedure klaw(var klawisz:byte); {Pobiera stan klawiatury}
var
r:registers;
begin
r.ax:=$0000;
Intr($16,r);
klawisz:=r.al;
end;
procedure czytaj_txt(patch:string;x,y:integer;color:word); {Rysuje tekst czytany z pliku}
var
plik: File;
c:char;
x2,y2:integer;
begin
SetColor(color);
assign(plik,patch);
reset(plik,1);
x2:=0;
y2:=0;
repeat
blockread(plik,c,1);
if ord(c)=13 then
begin
y2:=y2+8;
x2:=0;
end
else
begin
if ord(c)=10 then
begin
x2:=0;
end
else
begin
OutTextXY(x+x2,y+y2,c);
x2:=x2+8;
end;
end;
until eof(plik);
end;
function inttostr(i:integer):string;
var
s:string;
begin
str(i,s);
inttostr:=s;
end;
procedure pisz_txt(var s:string;var x,y:byte);
var
k:byte;
begin
klaw(k);
OutTextXY(x,y,chr(k));
end;
procedure ramka(x,y,maxx,maxy:integer;color:word);
begin
SetColor(color);
Line(x,y,x,maxy);
Line(x,y,maxx,y);
Line(maxx,y,maxx,maxy);
Line(x,maxy,maxx,maxy);
end;
end.